DEV Community 👩‍💻👨‍💻

zhonghua
zhonghua

Posted on

flutter 优秀dio网络拦截可视化

flutter_interceptor

flutter dio 拦截器

库源码:https://github.com/smartbackme/flutter_interceptor

开始集成

dependencies:
  flutter_interceptor: ^0.0.1
Enter fullscreen mode Exit fullscreen mode

dio添加拦截器

_dio.interceptors.add(UiNetInterceptor())
Enter fullscreen mode Exit fullscreen mode

页面插入浮动窗体

Overlay.of(context)?.insert(InterceptorDraggable());
Enter fullscreen mode Exit fullscreen mode

功能介绍:
1、请求可视化
2、可以复制请求内容

集成后的效果如图
Image descriptionImage descriptionImage descriptionImage descriptionImage description

Top comments (0)

🌚 Life is too short to browse without dark mode