Skip to content
pubscout

dio_flow

3.1.2, released 4 weeks ago by moeinmoradi.ir

Flexible Flutter HTTP client built on Dio with mock support, caching, and token management.

WASM-ready
$ flutter pub add dio_flow
Source repository

What it does

DioFlow is an HTTP client built on Dio that offers structured request handling, automatic token refreshing, local caching, and request mocking out of the box.

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

Use it when

  • You need a structured networking layer with built-in token management and single-flight refresh.
  • You want offline request mocking and built-in caching for GET requests.
  • You want robust retry logic and safe FormData cloning.

Skip it when

  • You prefer using raw Dio directly without wrapper response models.
  • Your project does not require an HTTP networking client.

Strengths

  • Built-in single-flight token refresh handling
  • Isolated local caching with query-key stabilization
  • Offline request mocking support

Weaknesses

  • Tied to a specific wrapper API instead of standard Dio clients
  • Adds an opinionated layer over Dio that you must learn

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Initialize DioFlowConfig and ApiClient in main().

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  DioFlowConfig.initialize(
    baseUrl: 'https://api.example.com',
  );
  await ApiClient.initialize();
  runApp(const MyApp());
}

Alternatives

Packages that do the same job and could replace dio_flow.

  • http

    If you want a lightweight built-in HTTP client instead of Dio.

Works with

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