Networking in Flutter using Dio

This is a sample Flutter app for demonstrating how to perform network requests using the Dio package. For this demo API provided by REQ | RES is used.

The functionalities of Dio showcased in this app are as follows:

  • GET request
  • POST request
  • PUT request
  • DELETE request
  • Base options
  • Uploading files
  • Interceptors

Demonstration

Request Type Demo
GET dio_get
POST dio_post
PUT dio_put
DELETE dio_delete

Packages

The packages used in this app are as follows:

Add them to your pubspec.yaml file like this:

dependencies:
  dio: ^4.0.0
  json_annotation: ^4.0.1

dev_dependencies:
  json_serializable: ^4.1.3
  build_runner: ^2.0.4

GitHub

https://github.com/sbis04/dio_networking