Skip to content
pubscout

dio

5.11.1, released 3 months ago by flutter.cn

A powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.

WASM-readyRock solid
$ flutter pub add dio
Source repository

What it does

Dio is an HTTP client for Dart and Flutter that supports global configurations, interceptors, FormData, request cancellation, file uploading and downloading, and custom adapters.

AI-written summary of version 5.11.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a full-featured HTTP client with advanced capabilities like interceptors and transformers
  • You need to handle complex multipart file uploads and download progress tracking

Skip it when

  • You only need to perform extremely basic HTTP requests and want to avoid third-party dependencies

Strengths

  • Supports global configuration, interceptors, and custom adapters
  • Built-in support for request cancellation and file upload/download progress

Weaknesses

  • Heavier dependency footprint compared to the core `http` package

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
7
import 'package:dio/dio.dart';

final dio = Dio();

void getHttp() async {
  final response = await dio.get('https://dart.dev');
  print(response);
}

Alternatives

Packages that do the same job and could replace dio.

  • http

    A simpler, official lower-level HTTP package if you do not need advanced features like interceptors.

Works with

Packages commonly used together with dio: ones it builds on, ones built on it, and its own family.