onResponse method
Called when the response is about to be resolved.
Implementation
@override
void onResponse(Response response, ResponseInterceptorHandler handler) {
final id = response.requestOptions.extra[_extraKey] as String?;
if (id != null && id.isNotEmpty) {
final bytes = response.data is List<int>
? (response.data as List<int>).length
: null;
HttpTracker.instance.endRequest(
id,
statusCode: response.statusCode,
responseBytes: bytes,
);
}
handler.next(response);
}