dio_log 1.3.0

dio_log #

pub package

http requests log of dio #

基于dio的网络请求日志 #

Add dependency #

添加依赖 #

dependencies: 
  dio_log : ^1.3.0 #^latest_version

set interceptor of dio #

给dio设置监听 #

dio.interceptors.add(DioLogInterceptor());

Add a global hover button on your home page to jump through the log list #

在你的主页面添加全局的悬浮按钮,用于跳转日志列表 #

///display overlay button 显示悬浮按钮
showDebugBtn(context);
///cancel overlay button 取消悬浮按钮
dismissDebugBtn();
///overlay button state of display 悬浮按钮展示状态
debugBtnIsShow()

Or open a log list where you want it to be #

或者在你期望的地方打开日志列表 #

Navigator.of(context).push(
    MaterialPageRoute(
      builder: (context) => HttpLogListWidget(),
    ),
  );  

Screenshot #

gif demo #

gif

[v1.3.0] - 2019/8/21

  • Optimize the request display UI
  • HttpLogInterceptor Deprecated and change it to DioLogInterceptor

[v1.2.1] - 2019/8/05

  • add example project
  • Fix the response parsing bug

[v1.2.0] - 2019/8/01

  • add overlay_draggable_button(Global float window is easier to open HttpLogListWidget)
  • add clear log function at requestList
  • add display requestTime at requestList

[v1.1.1] - 2019/7/22

  • add Screenshot

[v1.1.0] - 2019/7/22

  • support jsonView look at json

[v1.0.3] - 2019/7/16

  • fix some code
  • Lower the version needed by dio

[v1.0.2] - 2019/7/16

  • Add description information and example

[v1.0.1] - 2019/6/6

  • Add a display of the body content to the request
  • Logs with failed requests are shown in red in the list

[v1.0.0] - 2018/09/04

  • initial version

example/README.md

example #

example of dio log

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dio_log: ^1.3.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dio_log/dio_log.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
49
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
74
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/page/log_error_widget.dart. (-0.50 points)

Analysis of lib/page/log_error_widget.dart reported 1 hint:

line 16 col 10: This method overrides a method annotated as @mustCallSuper in 'AutomaticKeepAliveClientMixin', but does not invoke the overridden method.

Fix lib/page/log_request_widget.dart. (-0.50 points)

Analysis of lib/page/log_request_widget.dart reported 1 hint:

line 42 col 10: This method overrides a method annotated as @mustCallSuper in 'AutomaticKeepAliveClientMixin', but does not invoke the overridden method.

Fix lib/page/log_response_widget.dart. (-0.50 points)

Analysis of lib/page/log_response_widget.dart reported 1 hint:

line 20 col 10: This method overrides a method annotated as @mustCallSuper in 'AutomaticKeepAliveClientMixin', but does not invoke the overridden method.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
dio ^2.0.0 2.1.13
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
cookie_jar 1.0.1
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test