resolve method Null safety

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

Return the response directly! Other request interceptor(s) will not be executed, but response and error interceptor(s) may be executed, which depends on whether the value of parameter callFollowingResponseInterceptor is true.

response: Response object to return. callFollowingResponseInterceptor: Whether to call the response interceptor(s).

Implementation

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