RetryConfig class

Retry policy configuration

Example:

const RetryConfig(
  maxAttempts: 3,
  initialDelay: Duration(seconds: 1),
  maxDelay: Duration(seconds: 30),
  multiplier: 2.0,
  shouldRetry: myCustomRetryLogic,
)

Constructors

RetryConfig({int maxAttempts = 3, Duration initialDelay = const Duration(seconds: 1), Duration maxDelay = const Duration(seconds: 30), double multiplier = 2.0, bool shouldRetry(DioException)?})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
initialDelay → Duration
Initial delay before first retry
final
maxAttempts → int
Maximum number of retry attempts
final
maxDelay → Duration
Maximum delay between retries
final
multiplier → double
Exponential backoff multiplier
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shouldRetry → bool Function(DioException)?
Custom function to determine if request should be retried If null, uses default retry logic
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited