Fetch Data From fakestoreapi.com Api Using Dio . dio: ^4.0.4
A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, Request Cancellation, File downloading, Timeout etc.
-
- Depend on it Run this command:
$ flutter pub add dio
- This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
dependencies: dio: ^4.0.4
- Import it Now in your Dart code, you can use:
import 'package:dio/dio.dart';
-
- After creating your models just use it like this :