retryRequestWhen method

  1. @override
  2. @protected
FutureOr<bool> retryRequestWhen(
  1. BaseResponse response,
  2. int retryCount
)
override

This is used to determine whether a request should be retried

Implementation

@override
@protected
FutureOr<bool> retryRequestWhen(
  BaseResponse response,
  int retryCount,
) {
  final when = this.when;
  if (when != null) {
    return when(response, retryCount);
  }
  return super.retryRequestWhen(response, retryCount);
}