delay method

  1. @override
Duration delay(
  1. int attempt
)
override

Returns the delay before the given attempt (0-indexed).

Implementation

@override
Duration delay(int attempt) {
  final ms = baseDelay.inMilliseconds * (attempt + 1);
  final capped = math.min(ms, maxDelay.inMilliseconds);
  return Duration(milliseconds: capped);
}