RetryPolicy constructor
const
RetryPolicy({})
Creates a RetryPolicy.
maxRetries must be >= 0 and jitter must be between 0.0 and 1.0.
initialDelay should be positive and maxDelay should be >=
initialDelay (not enforced via asserts to preserve const
constructability, since Duration operations are not const-evaluable).
Implementation
const RetryPolicy({
this.maxRetries = 3,
this.initialDelay = const Duration(seconds: 1),
this.maxDelay = const Duration(seconds: 60),
this.jitter = 0.1,
}) : assert(maxRetries >= 0, 'maxRetries must be >= 0'),
assert(jitter >= 0.0 && jitter <= 1.0, 'jitter must be 0.0 - 1.0');