onResponse method

  1. @override
void onResponse(
  1. Response response,
  2. ResponseInterceptorHandler handler
)

Called when the response is about to be resolved.

Implementation

@override
void onResponse(
  Response<dynamic> response,
  ResponseInterceptorHandler handler,
) {
  // Log the cURL representation of the request if printOnSuccess is true.
  if (printOnSuccess == true) {
    _logCurlRepresentation(response.requestOptions, isError: false);
  }

  // Pass the response to the next handler in the chain.
  handler.next(response);
}