A small library for handle retry with max attempts or exponential backoff
view /example
folder for examples
await withRetry(
() => Future.error('error'),
maxAttempts: 10,
fallback: () => 1,
backOffType: BackOffType.exponential,
backOffDelay: Duration(seconds: 1),
onRetry: () {},
maxDelayBeetwenAttempts: Duration(seconds: 4),
);
await withRetryWhen(
() => Future.error('error'),
shouldRetryWhile: (exception) => exception is String,
backOffType: BackOffType.fixed,
);