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

[DioInspector]: flutter_ume_kit_dio always shows “Come back later ...” #118

Open
ruoduan-hub opened this issue May 18, 2023 · 2 comments

Comments

@ruoduan-hub
Copy link

ruoduan-hub commented May 18, 2023

flutter_ume_kit_dio always shows “Come back later ...”

  • code 👇🏻
import 'package:basecommonlib/basecommonlib.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'app.dart';
import 'application.dart';

import 'package:dio/dio.dart';

import 'package:flutter_ume/flutter_ume.dart'; // UME 框架
import 'package:flutter_ume_kit_ui/flutter_ume_kit_ui.dart'; // UI 插件包
import 'package:flutter_ume_kit_perf/flutter_ume_kit_perf.dart'; // 性能插件包
import 'package:flutter_ume_kit_show_code/flutter_ume_kit_show_code.dart'; // 代码查看插件包
import 'package:flutter_ume_kit_device/flutter_ume_kit_device.dart'; // 设备信息插件包
import 'package:flutter_ume_kit_console/flutter_ume_kit_console.dart'; // debugPrint 插件包
import 'package:flutter_ume_kit_dio/flutter_ume_kit_dio.dart'; // Dio 网络请求调试工具

final Dio dio = Dio()
  ..options = BaseOptions(
    baseUrl: Network.BASE_URL,
    connectTimeout: Network.CONNECT_TIMEOUT,
    receiveTimeout: Network.RECEIVE_TIMEOUT,
    contentType: Network.ContentTypeJson,
  );


void main() => Application.init(() {
      EnvironmentType envType = Network.CURRENT_ENVIRONMENT;
      if (envType == EnvironmentType.test) {
        PluginManager.instance // 注册插件
          ..register(WidgetInfoInspector())
          ..register(WidgetDetailInspector())
          ..register(ColorSucker())
          ..register(AlignRuler())
          ..register(ColorPicker()) // 新插件
          ..register(TouchIndicator()) // 新插件
          ..register(Performance())
          ..register(ShowCode())
          ..register(MemoryInfoPage())
          ..register(CpuInfoPage())
          ..register(DeviceInfoPanel())
          ..register(Console())
          ..register(DioInspector(dio: dio)); // 传入你的 Dio 实例
        // flutter_ume 0.3.0 版本之后
        return runApp(UMEWidget(child: MyApp(), enable: true)); // 初始化
      } else {
        return runApp(MyApp());
      }
    });
@ruoduan-hub
Copy link
Author

PS:

  • If I use "httpclient" not “Dio” then how to monitor the network request ? 🤔

@mdddj
Copy link

mdddj commented Jun 12, 2023

flutter_ume_kit_dio_plus: ^2.0.0

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

2 participants