Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 910 Bytes

migration_guide_0.4.0.md

File metadata and controls

27 lines (19 loc) · 910 Bytes

🚀 Migration guide to 0.4.0

❗️ Using strings instead of URIs

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.

extension ToURI on String {
  Uri toUri() => Uri.parse(this);
}

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.

0.4.0 and up

final response =
          await client.get("$baseUrl/weather".toUri(), params: {'id': "$id"});

0.3.3 and older

final response =
          await client.get("$baseUrl/weather", params: {'id': "$id"});