RetryPolicy.custom constructor

const RetryPolicy.custom({
  1. required int maxAttempts,
  2. required Duration delayForAttempt(
    1. int attempt
    ),
})

Creates a custom backoff policy. The delayForAttempt function is called with the attempt number (1-based) and should return the delay before that attempt.

Implementation

const factory RetryPolicy.custom({
  required int maxAttempts,
  required Duration Function(int attempt) delayForAttempt,
}) = _CustomRetry;