From afa77e0c386bdf01596d2055d249facde07745ef Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Sun, 17 Mar 2024 17:07:25 +0800 Subject: [PATCH] l10: fix for tools_ui.dart --- lib/app.dart | 12 ++++++------ lib/ui/tools/tools_ui.dart | 17 ++++++++++------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/app.dart b/lib/app.dart index 0d6170d..924c920 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -82,12 +82,12 @@ GoRouter router(RouterRef ref) { @riverpod class AppGlobalModel extends _$AppGlobalModel { - static final appLocaleSupport = { - const Locale("auto"): S.current.settings_app_language_auto, - const Locale("zh", "CN"): NoL10n.langZHS, - const Locale("zh", "TW"): NoL10n.langZHT, - const Locale("en"): NoL10n.langEn, - }; + static Map get appLocaleSupport => { + const Locale("auto"): S.current.settings_app_language_auto, + const Locale("zh", "CN"): NoL10n.langZHS, + const Locale("zh", "TW"): NoL10n.langZHT, + const Locale("en"): NoL10n.langEn, + }; @override AppGlobalState build() { diff --git a/lib/ui/tools/tools_ui.dart b/lib/ui/tools/tools_ui.dart index 69dc876..a69ab1b 100644 --- a/lib/ui/tools/tools_ui.dart +++ b/lib/ui/tools/tools_ui.dart @@ -71,7 +71,7 @@ class ToolsUI extends HookConsumerWidget { Expanded( child: SingleChildScrollView( padding: const EdgeInsets.all(16), - child: AlignedGridView.count( + child: MasonryGridView.count( crossAxisCount: 3, mainAxisSpacing: 12, crossAxisSpacing: 12, @@ -93,7 +93,6 @@ class ToolsUI extends HookConsumerWidget { final item = state.items[index]; return Container( width: 300, - height: 200, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), color: FluentTheme.of(context).cardColor, @@ -125,13 +124,13 @@ class ToolsUI extends HookConsumerWidget { ], ), const SizedBox(height: 12), - Expanded( - child: Text( + Text( item.infoString, style: TextStyle( fontSize: 14, color: Colors.white.withOpacity(.6)), - )), + ), + const SizedBox(height: 12), Row( children: [ const Spacer(), @@ -144,7 +143,11 @@ class ToolsUI extends HookConsumerWidget { try { item.onTap?.call(); } catch (e) { - showToast(context, S.current.tools_info_processing_failed(e)); + showToast( + context, + S.current + .tools_info_processing_failed( + e)); } }, child: const Padding( @@ -259,4 +262,4 @@ class ToolsUI extends HookConsumerWidget { ], ); } -} \ No newline at end of file +}