zubairehman / flutter_boilerplate_project

A boilerplate project created in flutter using MobX and Provider.
http://zubairehman.surge.sh/
MIT License
2.26k stars 905 forks source link

RestClient for http -> Uri.https was destroying URL #108

Open DariosKrimsKrams opened 3 years ago

DariosKrimsKrams commented 3 years ago

When I changed to RestClient (rest_client.dart), I run into an issue (because URL could not build correctly):

[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: FormatException: Invalid radix-10 number (at character 1)

I could solve it by changing rest_client.dart get-method line 14 from:

return http.get(Uri.https(Endpoints.baseUrl, path)).then(_createResponse);

to

return http.get(Uri.parse(path)).then(_createResponse);

Then it's working: Loading list of posts correctly :)