ionic-planb-logistic-app-fl.../lib/utils/logging_interceptor.dart
Mathias Beaulieu-Duncan 6986a12b91 auto-claude: subtask-6-1 - Run flutter analyze to ensure no errors or warnings
Fixed all 39 analyzer issues:
- Removed unused import (animation_system.dart in collapsible_routes_sidebar.dart)
- Removed unused element (_buildActionButton in dark_mode_map.dart)
- Fixed unnecessary non-null assertions on AppLocalizations.of(context)
- Removed unnecessary type checks in providers.dart
- Used super parameters for key in navigation_tc_dialog.dart and status_colors.dart
- Replaced print statements with debugPrint in providers.dart and logging_interceptor.dart

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-20 11:54:12 -05:00

34 lines
1.1 KiB
Dart

import 'package:flutter/foundation.dart';
import 'package:http_interceptor/http_interceptor.dart';
class LoggingInterceptor implements InterceptorContract {
@override
Future<BaseRequest> interceptRequest({required BaseRequest request}) async {
debugPrint('----------------------------------------------------');
debugPrint('REQUEST: ${request.method} ${request.url}');
debugPrint('Headers: ${request.headers}');
if (request is Request) {
debugPrint('Body: ${request.body}');
}
debugPrint('----------------------------------------------------');
return request;
}
@override
Future<BaseResponse> interceptResponse({required BaseResponse response}) async {
debugPrint('----------------------------------------------------');
debugPrint('RESPONSE: ${response.statusCode} ${response.request?.url}');
if (response is Response) {
debugPrint('Body: ${response.body}');
}
debugPrint('----------------------------------------------------');
return response;
}
@override
Future<bool> shouldInterceptRequest() async => true;
@override
Future<bool> shouldInterceptResponse() async => true;
}