It is clear way to add http to flutter
- Add this to your package’s pubspec.yaml file:
dependencies: http: ^0.12.0 // latest one might change
- Install it
You can install packages from the command line:
with pub:
$ pub get
with Flutter:
$ flutter packages get
- Import it
Now in your Dart code, you can use:
import 'package:http/http.dart';
If you have done these 3 steps restart your code editor