From 6d17c3ac085bbab4b808329c297a74787afac580 Mon Sep 17 00:00:00 2001 From: ErBW_s Date: Fri, 27 Dec 2024 12:37:26 +0800 Subject: [PATCH] modify plugin view page --- lib/pages/plugin_editor/plugin_view_page.dart | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/pages/plugin_editor/plugin_view_page.dart b/lib/pages/plugin_editor/plugin_view_page.dart index ae154808..bbaa8ea8 100644 --- a/lib/pages/plugin_editor/plugin_view_page.dart +++ b/lib/pages/plugin_editor/plugin_view_page.dart @@ -18,10 +18,13 @@ class PluginViewPage extends StatefulWidget { class _PluginViewPageState extends State { final PluginsController pluginsController = Modular.get(); + // 是否处于多选模式 bool isMultiSelectMode = false; + // 已选中的规则名称集合 final Set selectedNames = {}; + // 排序方式状态:false=按安装时间排序,true=按名称排序 bool sortByName = false; @@ -265,6 +268,8 @@ class _PluginViewPageState extends State { return Card( margin: const EdgeInsets.fromLTRB(8, 0, 8, 8), child: ListTile( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12)), onLongPress: () { if (!isMultiSelectMode) { setState(() { @@ -300,9 +305,31 @@ class _PluginViewPageState extends State { Row( children: [ Text( - 'Version: ${plugin.version}${canUpdate ? ' (可更新)' : ''}', + 'Version: ${plugin.version}', style: const TextStyle(color: Colors.grey), ), + if (canUpdate) ...[ + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, vertical: 2), + decoration: BoxDecoration( + color: Theme.of(context) + .colorScheme + .errorContainer, + borderRadius: BorderRadius.circular(4), + ), + child: Text( + '可更新', + style: TextStyle( + fontSize: 12, + color: Theme.of(context) + .colorScheme + .onErrorContainer, + ), + ), + ), + ], if (pluginsController.validityTracker .isSearchValid(plugin.name)) ...[ const SizedBox(width: 8),