normally the package should be imported like this:
import 'package:http/http.dart' as http;
but now I get this error:
[dart] Target of URI doesn't exist: 'package:http/http.dart'. [uri_does_not_exist]
did it somehow changed in the new updates of Flutter? if so, how can I perform a get request now?
It is clear way to add http to flutter
dependencies: http: ^0.12.0 // latest one might change
with pub:
$ pub get
with Flutter:
$ flutter packages get
import 'package:http/http.dart';
If you have done these 3 steps restart your code editor
Did you add it to pubspec
?
dependencies:
flutter:
sdk: flutter
http: 0.12.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With