RetryStrategy class
Constructors
-
RetryStrategy({int maxRetries = 5, Duration initialDelay = const Duration(seconds: 2), bool shouldRetryOnTimeout = true, bool shouldRetryOnServerError = true, bool shouldRetryOnNetworkError = true, List<
int> retryableStatusCodes = const [408, 429, 500, 502, 503, 504]}) -
const
- RetryStrategy.aggressive()
-
factory
- RetryStrategy.conservative()
-
factory
- RetryStrategy.noRetry()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialDelay → Duration
-
final
- maxRetries → int
-
final
-
retryableStatusCodes
→ List<
int> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldRetryOnNetworkError → bool
-
final
- shouldRetryOnServerError → bool
-
final
- shouldRetryOnTimeout → bool
-
final
Methods
-
getDelay(
int retryCount) → Duration -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldRetry(
int retryCount, Object? error, int? statusCode) → bool -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited