Compare commits

...

8 Commits

Author SHA1 Message Date
chen08209
74c3d0ae25 New Async UpdateConfig 2024-05-05 03:13:52 +08:00
chen08209
ecd1bcafd5 add changeProfileDebounce 2024-05-05 03:13:51 +08:00
chen08209
184d2d117a Update Workflow 2024-05-05 03:13:50 +08:00
chen08209
89e6f17794 Fix ChangeProfile block 2024-05-05 03:13:49 +08:00
chen08209
aef50fe0e3 Fix Release Message Error 2024-05-04 16:14:03 +08:00
chen08209
fc0767ed25 Update Selector 2 2024-05-04 01:14:56 +08:00
chen08209
dbf1724cca Update Version 2024-05-04 00:14:34 +08:00
chen08209
909aa4038e Fix Proxies Select Error 2024-05-04 00:14:07 +08:00
24 changed files with 327 additions and 121 deletions

View File

@@ -89,7 +89,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Download
uses: actions/download-artifact@v4
@@ -101,13 +101,13 @@ jobs:
- name: Pre Release
run: |
pip install gitchangelog pystache mustache markdown
prelease=$(curl --silent "https://api.github.com/repos/chen08209/FlClash/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' || echo "")
if [ -z "$prelease" ]; then
pre=$(curl --silent "https://api.github.com/repos/chen08209/FlClash/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' || echo "")
if [ -z "pre" ]; then
echo "init" > release.md
else
current="${{ github.ref_name }}"
echo -e "\n\n<details markdown=1><summary>All changes from $current to the latest commit:</summary>\n\n" >> release.md
gitchangelog "${prelease}" >> release.md 2>&1 || echo "Error in gitchangelog"
gitchangelog "${pre}.." >> release.md 2>&1 || echo "Error in gitchangelog"
echo -e "\n\n</details>" >> release.md
fi
- name: Release

View File

@@ -164,10 +164,7 @@ func patchConfig(general *config.General) {
resolver.DisableIPv6 = !general.IPv6
}
func applyConfig(isPatch bool) bool {
if currentConfig == nil {
return false
}
func applyConfig(isPatch bool) {
cfg, err := config.ParseRawConfig(currentConfig)
if err != nil {
cfg, _ = config.ParseRawConfig(config.DefaultRawConfig())
@@ -176,7 +173,5 @@ func applyConfig(isPatch bool) bool {
patchConfig(cfg.General)
} else {
executor.ApplyConfig(cfg, true)
}
return true
}

View File

@@ -24,7 +24,7 @@ func InitDartApi(api unsafe.Pointer) {
}
}
func sendToPort(port int64, msg string) {
func SendToPort(port int64, msg string) {
var obj C.Dart_CObject
obj._type = C.Dart_CObject_kString
msgString := C.CString(msg)

View File

@@ -24,5 +24,5 @@ func (message *Message) toJson() string {
}
func SendMessage(message Message) {
sendToPort(*Port, message.toJson())
SendToPort(*Port, message.toJson())
}

View File

@@ -63,21 +63,25 @@ func validateConfig(s *C.char) bool {
}
//export updateConfig
func updateConfig(s *C.char) bool {
paramsString := C.GoString(s)
var params = &GenerateConfigParams{}
err := json.Unmarshal([]byte(paramsString), params)
if err != nil {
log.Errorln("generateConfig Unmarshal error %v", err)
return false
}
prof := decorationConfig(params.ProfilePath, *params.Config)
currentConfig = prof
if *params.IsPatch {
return applyConfig(true)
} else {
return applyConfig(false)
}
func updateConfig(s *C.char, port C.longlong) {
i := int64(port)
go func() {
paramsString := C.GoString(s)
var params = &GenerateConfigParams{}
err := json.Unmarshal([]byte(paramsString), params)
if err != nil {
bridge.SendToPort(i, err.Error())
return
}
prof := decorationConfig(params.ProfilePath, *params.Config)
currentConfig = prof
if *params.IsPatch {
applyConfig(true)
} else {
applyConfig(false)
}
bridge.SendToPort(i, "")
}()
}
//export getProxies

View File

@@ -112,7 +112,6 @@ class ApplicationState extends State<Application> {
primaryColor: config.primaryColor,
),
builder: (_, state, child) {
debugPrint("[Application] update===>");
return DynamicColorBuilder(
builder: (lightDynamic, darkDynamic) {
_updateSystemColorSchemes(lightDynamic, darkDynamic);

View File

@@ -1,9 +1,11 @@
import 'dart:async';
import 'dart:convert';
import 'dart:ffi';
import 'dart:io';
import 'dart:isolate';
import 'package:ffi/ffi.dart';
import 'package:flutter/cupertino.dart';
import '../enum/enum.dart';
import '../models/models.dart';
import '../common/common.dart';
@@ -16,19 +18,22 @@ class ClashCore {
late final ClashFFI clashFFI;
late final DynamicLibrary lib;
ClashCore._internal() {
DynamicLibrary _getClashLib() {
if (Platform.isWindows) {
lib = DynamicLibrary.open("libclash.dll");
clashFFI = ClashFFI(lib);
return DynamicLibrary.open("libclash.dll");
}
if (Platform.isMacOS) {
lib = DynamicLibrary.open("libclash.dylib");
clashFFI = ClashFFI(lib);
return DynamicLibrary.open("libclash.dylib");
}
if (Platform.isAndroid || Platform.isLinux) {
lib = DynamicLibrary.open("libclash.so");
clashFFI = ClashFFI(lib);
return DynamicLibrary.open("libclash.so");
}
throw "Platform is not supported";
}
ClashCore._internal() {
lib = _getClashLib();
clashFFI = ClashFFI(lib);
clashFFI.initNativeApiBridge(
NativeApi.initializeApiDLData,
receiver.sendPort.nativePort,
@@ -61,12 +66,21 @@ class ClashCore {
1;
}
bool updateConfig(UpdateConfigParams updateConfigParams) {
Future<String> updateConfig(UpdateConfigParams updateConfigParams) {
final completer = Completer<String>();
final receiver = ReceivePort();
receiver.listen((message) {
if(!completer.isCompleted){
completer.complete(message);
receiver.close();
}
});
final params = json.encode(updateConfigParams);
return clashFFI.updateConfig(
params.toNativeUtf8().cast(),
) ==
1;
clashFFI.updateConfig(
params.toNativeUtf8().cast(),
receiver.sendPort.nativePort,
);
return completer.future;
}
Future<List<Group>> getProxiesGroups() {
@@ -74,14 +88,19 @@ class ClashCore {
final proxiesRawString = proxiesRaw.cast<Utf8>().toDartString();
return Isolate.run<List<Group>>(() {
final proxies = json.decode(proxiesRawString);
final groupNames =
(proxies[UsedProxy.GLOBAL.name]["all"] as List).where((e) {
final proxy = proxies[e];
return GroupTypeExtension.valueList.contains(proxy['type']);
});
final groupsRaw = [UsedProxy.GLOBAL.name, ...groupNames].map((groupName) {
final groupNames = [
UsedProxy.GLOBAL.name,
...(proxies[UsedProxy.GLOBAL.name]["all"] as List).where((e) {
final proxy = proxies[e];
return GroupTypeExtension.valueList.contains(proxy['type']);
})
];
final groupsRaw = groupNames.map((groupName) {
final group = proxies[groupName];
group["all"] = ((group["all"] ?? []) as List)
.where(
(name) => !groupNames.contains(groupNames),
)
.map(
(name) => proxies[name],
)

View File

@@ -907,19 +907,22 @@ class ClashFFI {
late final _validateConfig =
_validateConfigPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
int updateConfig(
void updateConfig(
ffi.Pointer<ffi.Char> s,
int port,
) {
return _updateConfig(
s,
port,
);
}
late final _updateConfigPtr =
_lookup<ffi.NativeFunction<GoUint8 Function(ffi.Pointer<ffi.Char>)>>(
'updateConfig');
late final _updateConfigPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<ffi.Char>, ffi.LongLong)>>('updateConfig');
late final _updateConfig =
_updateConfigPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
_updateConfigPtr.asFunction<void Function(ffi.Pointer<ffi.Char>, int)>();
ffi.Pointer<ffi.Char> getProxies() {
return _getProxies();

View File

@@ -19,8 +19,8 @@ Function debounce<F extends Function>(F func,{int milliseconds = 600}) {
if (timer != null) {
timer!.cancel();
}
timer = Timer(Duration(milliseconds: milliseconds), () {
Function.apply(func, args ?? [], namedArgs);
timer = Timer(Duration(milliseconds: milliseconds), () async {
await Function.apply(func, args ?? [], namedArgs);
});
};
}

View File

@@ -56,7 +56,9 @@ class AppController {
updateRunTime() {
if (proxyManager.startTime != null) {
final startTimeStamp = proxyManager.startTime!.millisecondsSinceEpoch;
final nowTimeStamp = DateTime.now().millisecondsSinceEpoch;
final nowTimeStamp = DateTime
.now()
.millisecondsSinceEpoch;
appState.runTime = nowTimeStamp - startTimeStamp;
} else {
appState.runTime = null;
@@ -115,7 +117,7 @@ class AppController {
}
}
Future<bool> updateClashConfig({bool isPatch = true}) async {
Future<String> updateClashConfig({bool isPatch = true}) async {
return await globalState.updateClashConfig(
clashConfig: clashConfig,
config: config,
@@ -123,12 +125,31 @@ class AppController {
);
}
applyProfile() async {
await globalState.applyProfile(
appState: appState,
config: config,
clashConfig: clashConfig,
);
}
Function? _changeProfileDebounce;
changeProfileDebounce(String? profileId) {
if (profileId == config.currentProfileId) return;
config.currentProfileId = profileId;
_changeProfileDebounce ??= debounce<Function(String?)>((profileId) async {
await applyProfile();
appState.delayMap = {};
saveConfigPreferences();
});
_changeProfileDebounce!([profileId]);
}
changeProfile(String? value) async {
if (value == config.currentProfileId) return;
config.currentProfileId = value;
await updateClashConfig(isPatch: false);
await updateGroups();
changeProxy();
await applyProfile();
appState.delayMap = {};
saveConfigPreferences();
}
@@ -138,14 +159,11 @@ class AppController {
if (!profile.autoUpdate) return;
final isNotNeedUpdate = profile.lastUpdateDate
?.add(
profile.autoUpdateDuration,
)
profile.autoUpdateDuration,
)
.isBeforeNow();
if (isNotNeedUpdate == false) continue;
final result = await profile.update();
if (result.type == ResultType.error) continue;
await updateGroups();
changeProxy();
await profile.update();
}
}
@@ -159,7 +177,7 @@ class AppController {
clearCurrentDelay() {
final currentProxyName =
appState.getCurrentProxyName(config.currentProxyName, clashConfig.mode);
appState.getCurrentProxyName(config.currentProxyName, clashConfig.mode);
if (currentProxyName == null) return;
appState.setDelay(Delay(name: currentProxyName, value: null));
}
@@ -246,7 +264,7 @@ class AppController {
toProfiles() {
final index = globalState.currentNavigationItems.indexWhere(
(element) => element.label == "profiles",
(element) => element.label == "profiles",
);
if (index != -1) {
toPage(index);
@@ -259,7 +277,7 @@ class AppController {
final commonScaffoldState = globalState.homeScaffoldKey.currentState;
if (commonScaffoldState?.mounted != true) return;
commonScaffoldState?.loadingRun(
() async {
() async {
await Future.delayed(const Duration(milliseconds: 300));
final profile = Profile(
url: url,
@@ -280,7 +298,7 @@ class AppController {
initLink() {
linkManager.initAppLinksListen(
(url) {
(url) {
globalState.showMessage(
title: "${appLocalizations.add}${appLocalizations.profile}",
message: TextSpan(
@@ -289,14 +307,20 @@ class AppController {
TextSpan(
text: " $url ",
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
color: Theme
.of(context)
.colorScheme
.primary,
decoration: TextDecoration.underline,
decorationColor: Theme.of(context).colorScheme.primary,
decorationColor: Theme
.of(context)
.colorScheme
.primary,
),
),
TextSpan(
text:
"${appLocalizations.create}${appLocalizations.profile}"),
"${appLocalizations.create}${appLocalizations.profile}"),
],
),
onTab: () {
@@ -316,7 +340,7 @@ class AppController {
final commonScaffoldState = globalState.homeScaffoldKey.currentState;
if (commonScaffoldState?.mounted != true) return;
commonScaffoldState?.loadingRun(
() async {
() async {
await Future.delayed(const Duration(milliseconds: 300));
final bytes = result.data?.bytes;
if (bytes == null) {

View File

@@ -12,7 +12,6 @@ class CoreInfo extends StatelessWidget {
return Selector<AppState, VersionInfo?>(
selector: (_, appState) => appState.versionInfo,
builder: (_, versionInfo, __) {
debugPrint("[CoreInfo] update===>");
return CommonCard(
info: Info(
label: appLocalizations.coreInfo,

View File

@@ -111,7 +111,6 @@ class _NetworkDetectionState extends State<NetworkDetection> {
);
},
builder: (_, state, __) {
debugPrint("[UpdateCurrentDelay] update===>");
_updateCurrentDelay(
state.currentProxyName,
state.delay,
@@ -145,7 +144,6 @@ class _NetworkDetectionState extends State<NetworkDetection> {
);
},
builder: (_, state, __) {
debugPrint("[NetworkDetection] update===>");
return Container(
padding: const EdgeInsets.all(16).copyWith(top: 0),
child: Column(

View File

@@ -63,7 +63,6 @@ class _StartButtonState extends State<StartButton>
hasProfile: config.profiles.isNotEmpty,
),
builder: (_, state, child) {
debugPrint("[StartButton] update===>");
if (!state.isInit || !state.hasProfile) {
return Container();
}

View File

@@ -24,6 +24,7 @@ class ProfilesFragment extends StatefulWidget {
}
class _ProfilesFragmentState extends State<ProfilesFragment> {
String _getLastUpdateTimeDifference(DateTime lastDateTime) {
final currentDateTime = DateTime.now();
final difference = currentDateTime.difference(lastDateTime);
@@ -209,7 +210,7 @@ class _ProfilesFragmentState extends State<ProfilesFragment> {
child: _profileItem(
profile: profile,
groupValue: state.currentProfileId,
onChanged: context.appController.changeProfile,
onChanged: context.appController.changeProfileDebounce,
),
),
],
@@ -234,7 +235,6 @@ class _ProfilesFragmentState extends State<ProfilesFragment> {
currentProfileId: config.currentProfileId,
),
builder: (context, state, child) {
debugPrint("[Profiles] update===>");
if (state.profiles.isEmpty) {
return NullStatus(
label: appLocalizations.nullProfileDesc,

View File

@@ -91,7 +91,6 @@ class _ProxiesFragmentState extends State<ProxiesFragment>
vsync: this,
initialIndex: state.currentIndex,
);
debugPrint("[Proxies] update===>");
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -194,7 +193,7 @@ class _ProxiesTabViewState extends State<ProxiesTabView>
_controller.dispose();
}
get group => widget.group;
Group get group => widget.group;
get measure => context.appController.measure;
@@ -366,25 +365,33 @@ class _ProxiesTabViewState extends State<ProxiesTabView>
}) {
return SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: AnimateGrid<Proxy>(
items: _getProxies(group.all, proxiesSortType),
columns: columns,
itemHeight: _getItemHeight(),
keyBuilder: (item) {
return ObjectKey(item);
},
builder: (_, proxy) {
return Selector3<AppState, Config, ClashConfig, String?>(
selector: (_, appState, config, clashConfig) =>
appState.getCurrentProxyName(
config.currentProxyName,
clashConfig.mode,
),
builder: (_, value, __) {
final currentProxyName =
group.type == GroupType.Selector ? value : group.now;
child: Selector3<AppState, Config, ClashConfig, ProxiesCardSelectorState>(
selector: (_, appState, config, clashConfig) =>
ProxiesCardSelectorState(
currentGroupName: appState.getCurrentGroupName(
config.currentGroupName,
clashConfig.mode,
),
currentProxyName: appState.getCurrentProxyName(
config.currentProxyName,
clashConfig.mode,
),
),
builder: (_, state, __) {
return AnimateGrid<Proxy>(
items: _getProxies(group.all, proxiesSortType),
columns: columns,
itemHeight: _getItemHeight(),
keyBuilder: (item) {
return ObjectKey(item);
},
builder: (_, proxy) {
final isSelected = group.type == GroupType.Selector
? group.name == state.currentGroupName &&
proxy.name == state.currentProxyName
: group.now == proxy.name;
return _card(
isSelected: proxy.name == currentProxyName,
isSelected: isSelected,
onPressed: () {
if (group.type == GroupType.Selector) {
final config = context.read<Config>();

View File

@@ -1887,3 +1887,148 @@ abstract class _ProxiesSelectorState implements ProxiesSelectorState {
_$$ProxiesSelectorStateImplCopyWith<_$ProxiesSelectorStateImpl>
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
mixin _$ProxiesCardSelectorState {
String? get currentGroupName => throw _privateConstructorUsedError;
String? get currentProxyName => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$ProxiesCardSelectorStateCopyWith<ProxiesCardSelectorState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ProxiesCardSelectorStateCopyWith<$Res> {
factory $ProxiesCardSelectorStateCopyWith(ProxiesCardSelectorState value,
$Res Function(ProxiesCardSelectorState) then) =
_$ProxiesCardSelectorStateCopyWithImpl<$Res, ProxiesCardSelectorState>;
@useResult
$Res call({String? currentGroupName, String? currentProxyName});
}
/// @nodoc
class _$ProxiesCardSelectorStateCopyWithImpl<$Res,
$Val extends ProxiesCardSelectorState>
implements $ProxiesCardSelectorStateCopyWith<$Res> {
_$ProxiesCardSelectorStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@pragma('vm:prefer-inline')
@override
$Res call({
Object? currentGroupName = freezed,
Object? currentProxyName = freezed,
}) {
return _then(_value.copyWith(
currentGroupName: freezed == currentGroupName
? _value.currentGroupName
: currentGroupName // ignore: cast_nullable_to_non_nullable
as String?,
currentProxyName: freezed == currentProxyName
? _value.currentProxyName
: currentProxyName // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
/// @nodoc
abstract class _$$ProxiesCardSelectorStateImplCopyWith<$Res>
implements $ProxiesCardSelectorStateCopyWith<$Res> {
factory _$$ProxiesCardSelectorStateImplCopyWith(
_$ProxiesCardSelectorStateImpl value,
$Res Function(_$ProxiesCardSelectorStateImpl) then) =
__$$ProxiesCardSelectorStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String? currentGroupName, String? currentProxyName});
}
/// @nodoc
class __$$ProxiesCardSelectorStateImplCopyWithImpl<$Res>
extends _$ProxiesCardSelectorStateCopyWithImpl<$Res,
_$ProxiesCardSelectorStateImpl>
implements _$$ProxiesCardSelectorStateImplCopyWith<$Res> {
__$$ProxiesCardSelectorStateImplCopyWithImpl(
_$ProxiesCardSelectorStateImpl _value,
$Res Function(_$ProxiesCardSelectorStateImpl) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@override
$Res call({
Object? currentGroupName = freezed,
Object? currentProxyName = freezed,
}) {
return _then(_$ProxiesCardSelectorStateImpl(
currentGroupName: freezed == currentGroupName
? _value.currentGroupName
: currentGroupName // ignore: cast_nullable_to_non_nullable
as String?,
currentProxyName: freezed == currentProxyName
? _value.currentProxyName
: currentProxyName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
class _$ProxiesCardSelectorStateImpl implements _ProxiesCardSelectorState {
const _$ProxiesCardSelectorStateImpl(
{required this.currentGroupName, required this.currentProxyName});
@override
final String? currentGroupName;
@override
final String? currentProxyName;
@override
String toString() {
return 'ProxiesCardSelectorState(currentGroupName: $currentGroupName, currentProxyName: $currentProxyName)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ProxiesCardSelectorStateImpl &&
(identical(other.currentGroupName, currentGroupName) ||
other.currentGroupName == currentGroupName) &&
(identical(other.currentProxyName, currentProxyName) ||
other.currentProxyName == currentProxyName));
}
@override
int get hashCode =>
Object.hash(runtimeType, currentGroupName, currentProxyName);
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$ProxiesCardSelectorStateImplCopyWith<_$ProxiesCardSelectorStateImpl>
get copyWith => __$$ProxiesCardSelectorStateImplCopyWithImpl<
_$ProxiesCardSelectorStateImpl>(this, _$identity);
}
abstract class _ProxiesCardSelectorState implements ProxiesCardSelectorState {
const factory _ProxiesCardSelectorState(
{required final String? currentGroupName,
required final String? currentProxyName}) =
_$ProxiesCardSelectorStateImpl;
@override
String? get currentGroupName;
@override
String? get currentProxyName;
@override
@JsonKey(ignore: true)
_$$ProxiesCardSelectorStateImplCopyWith<_$ProxiesCardSelectorStateImpl>
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -111,3 +111,10 @@ class ProxiesSelectorState with _$ProxiesSelectorState{
}) = _ProxiesSelectorState;
}
@freezed
class ProxiesCardSelectorState with _$ProxiesCardSelectorState{
const factory ProxiesCardSelectorState({
required String? currentGroupName,
required String? currentProxyName,
}) = _ProxiesCardSelectorState;
}

View File

@@ -140,7 +140,6 @@ class HomePage extends StatelessWidget {
child: Selector<AppState, List<NavigationItem>>(
selector: (_, appState) => appState.navigationItems,
builder: (_, navigationItems, __) {
debugPrint("[Home] update===>");
final desktopNavigationItems = navigationItems
.where(
(element) =>

View File

@@ -5,7 +5,6 @@ import 'dart:io';
import 'package:animations/animations.dart';
import 'package:fl_clash/clash/clash.dart';
import 'package:fl_clash/enum/enum.dart';
import 'package:fl_clash/models/clash_config.dart';
import 'package:fl_clash/plugins/app.dart';
import 'package:fl_clash/widgets/scaffold.dart';
import 'package:flutter/material.dart';
@@ -39,7 +38,7 @@ class GlobalState {
timer?.cancel();
}
Future<bool> updateClashConfig({
Future<String> updateClashConfig({
required ClashConfig clashConfig,
required Config config,
bool isPatch = true,
@@ -88,6 +87,25 @@ class GlobalState {
updateCurrentDelayDebounce!([proxyName]);
}
applyProfile({
required AppState appState,
required Config config,
required ClashConfig clashConfig,
}) async {
final res = await updateClashConfig(
clashConfig: clashConfig,
config: config,
isPatch: false,
);
if (res.isNotEmpty) return Result.error(message: res);
await updateGroups(appState);
changeProxy(
appState: appState,
config: config,
clashConfig: clashConfig,
);
}
init({
required AppState appState,
required Config config,
@@ -101,18 +119,12 @@ class GlobalState {
);
}
if (!appState.isInit) return;
await updateClashConfig(
clashConfig: clashConfig,
config: config,
isPatch: false,
);
updateGroups(appState);
updateCoreVersionInfo(appState);
changeProxy(
await applyProfile(
appState: appState,
config: config,
clashConfig: clashConfig,
);
updateCoreVersionInfo(appState);
}
changeProxy({
@@ -167,7 +179,7 @@ class GlobalState {
}
Future<void> updateGroups(AppState appState) async {
appState.groups = await clashCore.getProxiesGroups();
appState.groups = await clashCore.getProxiesGroups();
}
showMessage({

View File

@@ -15,7 +15,6 @@ class AppStateContainer extends StatelessWidget {
return Selector<Config, bool>(
selector: (_, config) => config.autoLaunch,
builder: (_, isAutoLaunch, child) {
debugPrint("[autoLaunchContainer] update===>");
autoLaunch?.updateStatus(isAutoLaunch);
return child!;
},
@@ -35,7 +34,6 @@ class AppStateContainer extends StatelessWidget {
);
},
builder: (context, state, child) {
debugPrint("[NavigationsContainer] update===>");
WidgetsBinding.instance.addPostFrameCallback(
(_) {
context.appController.appState.navigationItems =

View File

@@ -446,7 +446,6 @@ class _OpenContainerRoute<T> extends ModalRoute<T> {
return Selector<Config, ThemeMode>(
selector: (_, config) => config.themeMode,
builder: (_, __, ___) {
debugPrint("[OpenContainerTheme] update===>");
_colorTween = _getColorTween(
transitionType: transitionType,
closedColor: Theme.of(context).colorScheme.background,

View File

@@ -144,7 +144,6 @@ class _TrayContainerState extends State<TrayContainer> with TrayListener {
locale: config.locale,
),
builder: (_, state, child) {
debugPrint("[TrayContainer] update===>");
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
updateMenu(state);
});

View File

@@ -279,10 +279,10 @@ packages:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: "592dc01a18961a51c24ae5d963b724b2b7fa4a95c100fe8eb6ca8a5a4732cadf"
sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.18"
version: "2.0.19"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -957,10 +957,10 @@ packages:
dependency: "direct main"
description:
name: win32_registry
sha256: "10589e0d7f4e053f2c61023a31c9ce01146656a70b7b7f0828c0b46d7da2a9bb"
sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.3"
version: "1.1.2"
window_manager:
dependency: "direct main"
description:
@@ -997,10 +997,10 @@ packages:
dependency: transitive
description:
name: yaml_edit
sha256: c566f4f804215d84a7a2c377667f546c6033d5b34b4f9e60dfb09d17c4e97826
sha256: e9c1a3543d2da0db3e90270dbb1e4eebc985ee5e3ffe468d83224472b2194a5f
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.0"
version: "2.2.1"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

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.5
version: 0.7.8
environment:
sdk: '>=3.1.0 <4.0.0'