onResponse method
Called when the response is about to be resolved.
Implementation
@override
void onResponse(Response response, ResponseInterceptorHandler handler) {
final id = response.requestOptions.extra['id'] ?? 'UNKNOWN';
final startTime = response.requestOptions.extra['startTime'] as int?;
final duration = startTime != null
? DateTime.now().millisecondsSinceEpoch - startTime
: 0;
CoreLogger.log(
id: id,
type: LogType.response,
message: 'Response received',
statusCode: response.statusCode,
durationMs: duration,
data: response.data,
);
handler.next(response);
}