From fc0767ed256952310681baf14d4d123798fee727 Mon Sep 17 00:00:00 2001 From: chen08209 Date: Sat, 4 May 2024 01:14:56 +0800 Subject: [PATCH] Update Selector 2 --- lib/fragments/proxies.dart | 47 +++++++++++++++++++------------------- pubspec.yaml | 2 +- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/lib/fragments/proxies.dart b/lib/fragments/proxies.dart index 0f47d80..e72a8b5 100644 --- a/lib/fragments/proxies.dart +++ b/lib/fragments/proxies.dart @@ -366,32 +366,31 @@ class _ProxiesTabViewState extends State }) { return SingleChildScrollView( padding: const EdgeInsets.all(16), - child: AnimateGrid( - items: _getProxies(group.all, proxiesSortType), - columns: columns, - itemHeight: _getItemHeight(), - keyBuilder: (item) { - return ObjectKey(item); - }, - builder: (_, proxy) { - return Selector3( - selector: (_, appState, config, clashConfig) => - ProxiesCardSelectorState( - currentGroupName: appState.getCurrentGroupName( - config.currentGroupName, - clashConfig.mode, - ), - currentProxyName: appState.getCurrentProxyName( - config.currentProxyName, - clashConfig.mode, - ), - ), - builder: (_, state, __) { + child: Selector3( + selector: (_, appState, config, clashConfig) => + ProxiesCardSelectorState( + currentGroupName: appState.getCurrentGroupName( + config.currentGroupName, + clashConfig.mode, + ), + currentProxyName: appState.getCurrentProxyName( + config.currentProxyName, + clashConfig.mode, + ), + ), + builder: (_, state, __) { + return AnimateGrid( + 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 == state.currentProxyName; + proxy.name == state.currentProxyName + : group.now == proxy.name; return _card( isSelected: isSelected, onPressed: () { diff --git a/pubspec.yaml b/pubspec.yaml index 4573973..428c2d7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.6 +version: 0.7.7 environment: sdk: '>=3.1.0 <4.0.0'