calculateDelay method
Implementation
Duration calculateDelay(int attempt) {
final delay = Duration(
milliseconds:
(baseDelay.inMilliseconds * pow(backoffMultiplier, attempt)).round(),
);
return delay > maxDelay ? maxDelay : delay;
}