Skip to content
pubscout

dio_smart_retry

7.0.1, released 2 years ago by rodion-m.ru

Flexible request retry library for the Dio HTTP client package.

WASM-ready
$ flutter pub add dio_smart_retry
Source repository

What it does

Adds an interceptor to the Dio HTTP client that automatically retries failed requests based on HTTP status codes. Supports dynamic delays between retries and customizable retry evaluation rules.

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

Use it when

  • You need automatic retries for transient network failures or server errors using Dio.
  • You want to configure custom retry delays and retryable HTTP status codes.

Skip it when

  • You are not using the Dio package for HTTP requests.
  • You want a state management or storage solution.

Strengths

  • Supports dynamic delay intervals between retries.
  • Customizable retryable status codes and evaluation logic.
  • Easy integration via Dio interceptors.

Weaknesses

  • Strictly tied to the Dio networking package.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3

Add the package to pubspec.yaml and add RetryInterceptor to your Dio instance.

final dio = Dio();
dio.interceptors.add(RetryInterceptor(
  dio: dio,
  logPrint: print,
  retries: 3,
  retryDelays: const [
    Duration(seconds: 1),
    Duration(seconds: 2),
    Duration(seconds: 3),
  ],
));

Alternatives

Packages that do the same job and could replace dio_smart_retry.

  • http2

    An HTTP/2 implementation in Dart for low-level transport and pooled HTTP/2 requests.

  • dio_web_adapter

    Web and WASM HTTP client adapter for Dio.

  • native_dio_adapter

    A Dio HTTP client adapter that uses native platform HTTP stacks via cupertino_http and cronet_http.

  • http

    A composable, Future‑based library for making HTTP requests across platforms.

Works with

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