FLUTTER ECOSYSTEM

retry

Utility for wrapping an asynchronous function in automatic retry logic with exponential back-off, useful when making requests over network.

Latest version
3.1.2
30-day downloads
2.1M
Likes
1.1K
Pub points
160

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

The retry package provides a simple utility to wrap asynchronous functions with automatic retry logic using exponential back-off. It's particularly useful for network requests that may fail temporarily due to connectivity issues. By wrapping a function with retry logic, developers can ensure robustness without manually implementing retry mechanisms. The package is designed to be lightweight and integrates seamlessly into Dart applications. It supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux.

Use cases
  • Network request resilience
  • API call retries
  • Temporary service outages
  • Background task reliability
  • Database operation retries
  • Streaming data recovery
Key features
  • Exponential back-off strategy
  • Automatic retry on failure
  • Configurable retry count
  • Supports async/await
  • Lightweight and minimal dependencies
  • Platform-agnostic
Suitable for
  • Network-heavy apps
  • Cloud service integrations
  • Offline-first applications
  • Microservices communication
  • Real-time data synchronization
  • High-availability systems
Considerations
  • May increase latency during failures
  • Not suitable for idempotent operations without care
  • Requires careful configuration of retry limits
  • Can lead to resource exhaustion if misused
  • Best paired with timeout handling
  • Should not replace proper error handling
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add retry

Categories

Source repository

Related projects

Rankings