ansi_logger 2.0.11 ansi_logger: ^2.0.11 copied to clipboard
Flutter package tht help you make pretty logs, and has alogger for http
ansi_logger #
Pretty logger with ansi colors
How to use #
see the example
Screenshots #
Working with dio #
- first create
Interceptor
and overrideonRequest
andonError
method
class _Interceptor extends Interceptor {
@override
void onError(DioError err, ErrorInterceptorHandler handler) {
super.onError(err, handler);
// See the example to know how to log this Error
}
@override
void onResponse(Response response, ResponseInterceptorHandler handler) {
super.onResponse(response, handler);
// See the example to know how to log this response
}
}
- then you should use this Interceptor
Dio dio = Dio();
dio.interceptors.add(_Interceptor());
dio.get("https://jsonplaceholder.typicode.com/todos/1");