retryWith<R> method

FutureOr<R?> retryWith<R>({
  1. List? args,
  2. Map<Symbol, dynamic>? named,
  3. R? defaultValue,
  4. bool throwOnRetryExhaustion = false,
  5. int maxRetries = 3,
  6. Duration? retryDelay,
  7. Duration? computeDelay(
    1. int retry
    )?,
  8. bool? onError(
    1. Object error,
    2. StackTrace stackTrace,
    3. int retries
    )?,
})

Alias to asyncRetry.

Implementation

FutureOr<R?> retryWith<R>({
  List<dynamic>? args,
  Map<Symbol, dynamic>? named,
  R? defaultValue,
  bool throwOnRetryExhaustion = false,
  int maxRetries = 3,
  Duration? retryDelay,
  Duration? Function(int retry)? computeDelay,
  bool? Function(Object error, StackTrace stackTrace, int retries)? onError,
}) {
  return asyncRetry<R>(
    () => Function.apply(this, args, named),
    defaultValue: defaultValue,
    throwOnRetryExhaustion: throwOnRetryExhaustion,
    maxRetries: maxRetries,
    retryDelay: retryDelay,
    computeDelay: computeDelay,
    onError: onError,
  );
}