Dio Requests Inspector
A HTTP inspector for Dio, which can intercept and log HTTP requests and responses.
Features
X
Intercept and log HTTP requests and responsesX
Secure HTTP requests with passwordsX
Filter logs by request time, method, and statusX
Search logs by pathX
Easily share request and response dataX
Beautify JSON dataX
Beautiful user interface
How to use
- Add the package with command
flutter pub add dio_request_inspector
- add
navigatorObservers
to yourMaterialApp
navigatorObservers: [
DioRequestInspector.navigatorObserver,
],
- Wrap your
myApp
withDioRequestInspectorMain
void main() {
runApp(DioRequestInspectorMain(
isDebugMode: true,
child: MyApp(),
));
}
- add interceptor to your Dio instance
final DioRequestInspector inspector = DioRequestInspector(
isDebugMode: true,
duration: const Duration(milliseconds: 500),
showFloating: true,
password: '123456',
);
dio.interceptors.add(inspector.getDioRequestInterceptor());
see detail example
Note
- tap
Long press
on your screen to show DioRequestInspector UI