onResponse method
Called when the response is about to be resolved.
Implementation
@override
void onResponse(
Response<dynamic> response,
ResponseInterceptorHandler handler,
) {
if (logResponse) {
final box = _Box('RESPONSE')
..line(
'${response.statusCode} '
'${response.requestOptions.method} '
'${response.requestOptions.uri}',
);
if (logHeaders) box.section('Headers', response.headers.map);
if (logBody && response.data != null) {
box.section('Body', response.data);
}
_log(box.toString());
}
handler.next(response);
}