init method

Future<void> init({
  1. String toolTitle = 'KDebugTools',
  2. bool autoStartWebServer = false,
  3. bool autoStartHttpHook = false,
  4. List<String>? allServEnvKeys,
  5. List<ServerEnvConfig>? allServConfigs,
})

初始化

Implementation

Future<void> init(
    {String toolTitle = 'KDebugTools',
    bool autoStartWebServer = false,
    bool autoStartHttpHook = false,
    List<String>? allServEnvKeys,
    List<ServerEnvConfig>? allServConfigs}) async {
  _title = toolTitle;
  await ServerEnv.instance.init(allServEnvKeys, allServConfigs);
  await NetworkDebugger.instance.init();
  if (autoStartWebServer) {
    await WebServer.instance.start();
  }
  if (autoStartHttpHook) {
    HttpHookController.instance.setEnable(true);
  }

  DebuggerRegister.instance.registerDefault();
  return Future.value();
}