next method

  1. @override
Future<Response> next(
  1. Request request
)
override

This method is called on every request. Calling super.next will cause invocation of next method in the next ApiLink in the chain (if present)

Implementation

@override
Future<Response> next(Request request) async {
  request.headers.addAll(_headers);
  final response = await super.next(request);
  setHeaders(response.headers);
  return response;
}