nextDelay method
Returns the delay before the next retry, or null for immediate retry
attempt is the current attempt number (0-based for first attempt).
error is the error that caused the failure.
stackTrace is the stack trace of the error.
Implementation
@override
Duration? nextDelay(int attempt, Object error, StackTrace stackTrace) {
final delayMs = baseDelay.inMilliseconds * (multiplier.pow(attempt));
final cappedMs = delayMs.round().clamp(0, maxDelay.inMilliseconds);
return Duration(milliseconds: cappedMs);
}