backOff method
Converts this into a BackOff function.
Implementation
Future<T> backOff({
Duration delayFactor = const Duration(milliseconds: 200),
double randomizationFactor = 0.25,
Duration maxDelay = const Duration(seconds: 30),
int maxAttempts = 8,
FutureOr<bool> Function(Object error, int attempt)? retry,
}) =>
BackOff(
this,
delayFactor: delayFactor,
randomizationFactor: randomizationFactor,
maxDelay: maxDelay,
maxAttempts: maxAttempts,
retryIf: retry,
).call();