SwrRetryPolicy class

Configures how executeWithRetry retries a failing fetch.

Constructors

SwrRetryPolicy({int maxAttempts = 5, Duration backoff(int attempt)?, bool shouldRetry(Object error, int attempt)?})
const

Properties

backoff → Duration Function(int attempt)
Delay to wait before the given 1-based attempt's retry. Defaults to exponential backoff: min(2^(attempt-1) * 1s, 30s).
final
hashCode → int
The hash code for this object.
no setterinherited
maxAttempts → int
Maximum number of attempts, including the first (non-retry) one.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shouldRetry → bool Function(Object error, int attempt)?
Whether to retry after attempt failed with error. Defaults to always retrying until maxAttempts is exhausted.
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