Skip to content

Commit a8a883e

Browse files
committed
docs: tidy up documentation before release
1 parent 4e0ae8f commit a8a883e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ class WeatherRepository {
127127
Future<Map<String, dynamic>> fetchCityWeather(int id) async {
128128
var parsedWeather;
129129
try {
130+
WeatherApiInterceptor http = HttpWithInterceptor.build(interceptors: [
131+
Logger(),
132+
]);
130133
final response =
131-
await client.get("$baseUrl/weather".toUri(), params: {'id': "$id"});
134+
await http.get("$baseUrl/weather".toUri(), params: {'id': "$id"});
132135
if (response.statusCode == 200) {
133136
parsedWeather = json.decode(response.body);
134137
} else {

guides/migration_guide_4.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@
44

55
Since `http` dropped support for using string as url when creating requests, we had to implement an alternative way in order to keep it as close as possible to current syntax. To do this we created a new extension on String that allows you to transform any string into an URI. The function is called `toUri()` and is available anywhere with the import of `http_interceptor`.
66

7+
```dart
8+
extension ToURI on String {
9+
Uri toUri() => Uri.parse(this);
10+
}
11+
```
12+
713
This method is really useful when you have different environments and that's why we tried our best to keep it as part of the library.
814

9-
**0.14.0 and older**
15+
**0.4.0 and up**
1016

1117
```dart
1218
final response =
1319
await client.get("$baseUrl/weather".toUri(), params: {'id': "$id"});
1420
```
1521

16-
**0.13.3 and older**
22+
**0.3.3 and older**
1723

1824
```dart
1925
final response =

0 commit comments

Comments
 (0)