Optimize proxies page

Fix ua issues

Optimize more details
This commit is contained in:
chen08209
2024-07-24 01:27:49 +08:00
parent c36df8cb4a
commit 6de89d7de4
44 changed files with 1575 additions and 636 deletions

View File

@@ -47,6 +47,7 @@ Future<void> main() async {
Future<void> vpnService() async {
WidgetsFlutterBinding.ensureInitialized();
globalState.isVpnService = true;
globalState.packageInfo = await PackageInfo.fromPlatform();
final config = await preferences.getConfig() ?? Config();
final clashConfig = await preferences.getClashConfig() ?? ClashConfig();
final appState = AppState(
@@ -86,11 +87,10 @@ Future<void> vpnService() async {
final currentSelectedMap = config.currentSelectedMap;
final proxyName = currentSelectedMap[groupName];
if (proxyName == null) return;
clashCore.changeProxy(
ChangeProxyParams(
groupName: groupName,
proxyName: proxyName,
),
globalState.changeProxy(
config: config,
groupName: groupName,
proxyName: proxyName,
);
},
),
@@ -119,7 +119,7 @@ Future<void> vpnService() async {
globalState.updateTraffic();
globalState.updateFunctionLists = [
() {
() {
globalState.updateTraffic();
}
];
@@ -137,8 +137,7 @@ class ServiceMessageHandler with ServiceMessageListener {
required Function(Process process) onProcess,
required Function(String runTime) onStarted,
required Function(String groupName) onLoaded,
})
: _onProtect = onProtect,
}) : _onProtect = onProtect,
_onProcess = onProcess,
_onStarted = onStarted,
_onLoaded = onLoaded;