Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有Demo吗 ?看不了啊 #2

Closed
SilenceZhou opened this issue Feb 27, 2019 · 5 comments
Closed

有Demo吗 ?看不了啊 #2

SilenceZhou opened this issue Feb 27, 2019 · 5 comments
Assignees

Comments

@SilenceZhou
Copy link

No description provided.

@lijy91
Copy link
Member

lijy91 commented Feb 27, 2019

这是 Dio 2.0 的示例,请将示例中的 flipper_dio_interceptor.dart 文件添加到你的项目
https://github.com/blankapp/flutter_flipperkit/blob/master/example/lib/networking/api_client/api_client.dart

BaseOptions options = new BaseOptions(
      baseUrl: 'https://www.v2ex.com/api',
      connectTimeout: 5000,
      receiveTimeout: 3000,
      headers: {
        "Accept": "application/json",
        "Content-Type": "application/json"
      },
      responseType: ResponseType.json,
    );
    this._http = new Dio(options);
    // 添加 FlipperDioInterceptor 拦截器
    this._http.interceptors.add(FlipperDioInterceptor());

@lijy91 lijy91 closed this as completed Feb 27, 2019
@lijy91 lijy91 self-assigned this Mar 7, 2019
@zakiso
Copy link

zakiso commented Mar 23, 2019

只有使用dio做为网络请求客户端的时候 才能用吗?

@lijy91
Copy link
Member

lijy91 commented Mar 24, 2019

@zakiso flutter_flipperkit (将在 0.0.7 中发布该功能,请留意版本更新) 已支持全局拦截网络请求(所有基于 HttpClient API 的请求均可被拦截),如果你未设置网络插件 useHttpOverrides 参数为 false,则无需使用该拦截器。

如果其他网络请求库无法被自动拦截,则可能参考 Dio 的实现。
https://github.com/blankapp/flutter_flipperkit_plugins/tree/master/packages/flipperkit_dio_interceptor

如有疑问可加入电报群 https://t.me/flutterdebugger 提问。

@zakiso
Copy link

zakiso commented Mar 24, 2019

👍 期待新版本

@lijy91
Copy link
Member

lijy91 commented Mar 26, 2019

@zakiso Flutter Debugger 已经发布,
下载:https://github.com/blankapp/flutter-debugger/releases/
文档:https://flutter-debugger.blankapp.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants