RetryExponential constructor
RetryExponential({})
Creates an exponential backoff retry policy
maxAttempts is the total number of attempts (initial + retries).
baseDelay is the delay for the first retry.
multiplier is applied to the delay for each subsequent retry (default: 2.0).
maxDelay caps the maximum delay (default: 1 minute).
Implementation
RetryExponential({
required int maxAttempts,
required Duration baseDelay,
double multiplier = 2.0,
Duration maxDelay = const Duration(minutes: 1),
}) : maxAttempts = _validateMaxAttempts(maxAttempts),
baseDelay = _validateNonNegativeDuration(baseDelay, 'baseDelay'),
multiplier = _validatePositiveFinite(multiplier, 'multiplier'),
maxDelay = _validateNonNegativeDuration(maxDelay, 'maxDelay');