dio_smart_retry
7.0.1, released 2 years ago by rodion-m.ru
Flexible request retry library for the Dio HTTP client package.
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.
91Compare - dio_web_adapter
Web and WASM HTTP client adapter for Dio.
83Compare - native_dio_adapter
A Dio HTTP client adapter that uses native platform HTTP stacks via cupertino_http and cronet_http.
87Compare - http
A composable, Future‑based library for making HTTP requests across platforms.
86Compare
Works with
Packages commonly used together with dio_smart_retry: ones it builds on, ones built on it, and its own family.
- http_parserdio_smart_retry depends on itA platform-independent package for parsing and serializing HTTP formats.
- diodio_smart_retry depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- coingecko_apiBuilt on dio_smart_retryDart package providing simple access to the CoinGecko API (Version 3).
- feature_flags_togglyBuilt on dio_smart_retryFeature flags support for Flutter applications with or without Toggly.io.