resolve method

void resolve(
  1. Response response, [
  2. bool callFollowingResponseInterceptor = false
])

Completes the request by resolves the response as the result.

Invoking the method will make the rest of interceptors in the queue skipped to handle the request, unless callFollowingResponseInterceptor is true which delivers InterceptorResultType.resolveCallFollowing to the InterceptorState.

Implementation

void resolve(
  Response response, [
  bool callFollowingResponseInterceptor = false,
]) {
  _throwIfCompleted();
  _completer.complete(
    InterceptorState<Response>(
      response,
      callFollowingResponseInterceptor
          ? InterceptorResultType.resolveCallFollowing
          : InterceptorResultType.resolve,
    ),
  );
  _processNextInQueue?.call();
}