modifyResponse<T> method

Future<Response<T>> modifyResponse<T>(
  1. Request<T> request,
  2. Response<T> response
)

Implementation

Future<Response<T>> modifyResponse<T>(
    Request<T> request, Response<T> response) async {
  var newResponse = response;
  if (_responseModifiers.isNotEmpty) {
    for (var interceptor in _responseModifiers) {
      newResponse = await interceptor(request, response) as Response<T>;
    }
  }

  return newResponse;
}