Overview
Dio Smart Retry is a retry utility for the Dio HTTP client, designed to automatically retry requests based on predefined conditions. It defaults to retrying only for HTTP status codes considered retryable, such as 5xx server errors or network timeouts. Built with simplicity and reliability in mind, it integrates seamlessly with existing Dio setups. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for robust network operations in cross-platform Flutter apps.
Use cases
- Handling transient network failures
- Automating retries for server errors
- Improving app resilience during poor connectivity
- Simplifying error handling in API calls
- Reducing manual retry logic in business code
Key features
- Automatic retry for retryable HTTP statuses
- Easy integration with Dio
- Supports multiple platforms
- Configurable retry behavior
- Lightweight and minimal overhead
Suitable for
- Flutter apps with frequent API calls
- Apps requiring reliable network communication
- Developers seeking simple retry logic
- Projects using Dio for HTTP requests
- Teams wanting to reduce boilerplate error handling
Considerations
- Does not retry by default for client errors (4xx)
- Custom retry logic requires additional configuration
- Limited to Dio-based HTTP clients
- May need tuning for high-latency environments
- No built-in backoff strategy beyond basic retry