123456789101112131415161718192021222324252627282930313233343536373839 |
- import 'dart:io';
- import 'package:get/get.dart';
- import 'package:naiyouwl/clash_generated_bindings.dart';
- class GlobalConfigFileController extends GetxController{
- static bool isStartClash = false;
- late Directory configDir;
- late final Clash clash;
- late final String clashConfigPath;
- late final String clashForMePath;
- late final String profilesPath;
- var systemProxy = false.obs;
- // var clashConfig = Config.defaultConfig().obs;
- // var clashForMe = ClashForMeConfig.defaultConfig().obs;
- //
- // Future<void> init() async {
- // await getApplicationSupportDirectory().then((dir) => configDir = dir);
- //
- // profilesPath = "${configDir.path}${Constants.profilesPath}";
- // clashForMePath = "${configDir.path}${Constants.clashForMe}";
- // clashConfigPath = "${configDir.path}${Constants.clashConfig}";
- //
- // await _initClash();
- // _initConfig();
- // _initAction();
- // }
- //
- // _initConfig() async {
- // ClashForMeConfig? tempCfm = ClashForMeConfig.formYamlFile(clashForMePath);
- // tempCfm = await _profilesInitCheck(tempCfm);
- // if (tempCfm != null) {
- // clashForMe.value = tempCfm;
- // }
- //
- // clashConfig.value = Config.formYamlFile(clashConfigPath);
- // }
- }
|