copyWith method

RetryConfig copyWith({
  1. int? maxAttempts,
  2. Duration? initialDelay,
  3. Duration? maxDelay,
  4. Duration? timeoutDuration,
  5. bool shouldRetry(
    1. Exception error
    )?,
})

Creates a copy with updated values.

Implementation

RetryConfig copyWith({
  int? maxAttempts,
  Duration? initialDelay,
  Duration? maxDelay,
  Duration? timeoutDuration,
  bool Function(Exception error)? shouldRetry,
}) {
  return RetryConfig(
    maxAttempts: maxAttempts ?? this.maxAttempts,
    initialDelay: initialDelay ?? this.initialDelay,
    maxDelay: maxDelay ?? this.maxDelay,
    timeoutDuration: timeoutDuration ?? this.timeoutDuration,
    shouldRetry: shouldRetry ?? this.shouldRetry,
  );
}