Compare commits

...

3 Commits

Author SHA1 Message Date
chen08209
fd1dfe5c60 Fix Tab destroy error 2024-05-06 19:05:27 +08:00
chen08209
9f89fe8b29 Optimize repeat healthcheck 2024-05-06 17:17:26 +08:00
chen08209
78081a12e8 Optimize Direct mode ui 2024-05-06 15:27:37 +08:00
8 changed files with 26 additions and 9 deletions

View File

@@ -193,7 +193,6 @@ func hcCompatibleProvider(proxyProviders map[string]provider.ProxyProvider) {
}
}
}
func applyConfig(isPatch bool) {
@@ -205,5 +204,6 @@ func applyConfig(isPatch bool) {
patchConfig(cfg.General)
} else {
executor.ApplyConfig(cfg, true)
healthcheck()
}
}

View File

@@ -120,6 +120,10 @@ func changeProxy(s *C.char) bool {
return true
}
// clearEffect
func clearConfigEffect() {
}
//export getTraffic
func getTraffic() *C.char {
up, down := statistic.DefaultManager.Now()

View File

@@ -1,4 +1,5 @@
import 'package:fl_clash/common/common.dart';
import 'package:fl_clash/enum/enum.dart';
import 'package:fl_clash/models/models.dart';
import 'package:fl_clash/widgets/widgets.dart';
import 'package:flutter/material.dart';
@@ -24,6 +25,11 @@ class _NetworkDetectionState extends State<NetworkDetection> {
),
);
}
if (currentProxyName == UsedProxy.DIRECT.name) {
return const Icon(
Icons.offline_bolt_outlined,
);
}
if (delay == 0 || delay == null) {
return const AspectRatio(
aspectRatio: 1,

View File

@@ -51,7 +51,7 @@ class _StartButtonState extends State<StartButton>
final appController = context.appController;
await appController.updateSystemProxy(isStart);
if (isStart && mounted) {
appController.clearCurrentDelay();
appController.healthcheck();
}
}

View File

@@ -83,6 +83,13 @@ class _ProxiesFragmentState extends State<ProxiesFragment>
groupNames: groupNames,
);
},
shouldRebuild: (prev,next){
if(prev.groupNames.length != next.groupNames.length){
_tabController?.dispose();
_tabController =null;
}
return prev != next;
},
builder: (_, state, __) {
_tabController ??= TabController(
length: state.groupNames.length,
@@ -114,7 +121,6 @@ class _ProxiesFragmentState extends State<ProxiesFragment>
children: [
for (final groupName in state.groupNames)
KeepContainer(
key: ObjectKey(groupName),
child: ProxiesTabView(
groupName: groupName,
),

View File

@@ -38,13 +38,14 @@ class _ClashMessageContainerState extends State<ClashMessageContainer>
@override
void onDelay(Delay delay) {
final appController = context.appController;
appController.setDelay(delay);
globalState.healthcheckLock = true;
context.appController.setDelay(delay);
WidgetsBinding.instance.addPostFrameCallback((_) {
globalState.updateSortNumDebounce ??= debounce<Function()>(
() {
context.appController.updateGroups();
context.appController.appState.sortNum++;
() async {
await appController.updateGroups();
appController.appState.sortNum++;
globalState.healthcheckLock = false;
},
milliseconds: 5000,

View File

@@ -1,7 +1,7 @@
name: fl_clash
description: A multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free.
publish_to: 'none'
version: 0.7.10
version: 0.7.13
environment:
sdk: '>=3.1.0 <4.0.0'