Fix windows some issues
Optimize overwrite handle Optimize access control page Optimize some details
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
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/providers/state.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -19,17 +20,29 @@ class _VpnContainerState extends ConsumerState<VpnManager> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
ref.listenManual(vpnStateProvider, (prev, next) {
|
||||
showTip();
|
||||
if (prev != next) {
|
||||
showTip(next);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void showTip() {
|
||||
void showTip(VpnState state) {
|
||||
throttler.call(
|
||||
FunctionTag.vpnTip,
|
||||
() {
|
||||
if (ref.read(isStartProvider)) {
|
||||
globalState.showNotifier(appLocalizations.vpnTip);
|
||||
if (!ref.read(isStartProvider) || state == globalState.lastVpnState) {
|
||||
return;
|
||||
}
|
||||
globalState.showNotifier(
|
||||
appLocalizations.vpnConfigChangeDetected,
|
||||
actionState: MessageActionState(
|
||||
actionText: appLocalizations.restart,
|
||||
action: () async {
|
||||
await globalState.handleStop();
|
||||
await globalState.appController.updateStatus(true);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
duration: const Duration(seconds: 6),
|
||||
fire: true,
|
||||
|
||||
Reference in New Issue
Block a user