l10: fix for tools_ui.dart

This commit is contained in:
xkeyC 2024-03-17 17:07:25 +08:00
parent 17588dfab8
commit afa77e0c38
2 changed files with 16 additions and 13 deletions

View File

@ -82,12 +82,12 @@ GoRouter router(RouterRef ref) {
@riverpod @riverpod
class AppGlobalModel extends _$AppGlobalModel { class AppGlobalModel extends _$AppGlobalModel {
static final appLocaleSupport = { static Map<Locale, String> get appLocaleSupport => {
const Locale("auto"): S.current.settings_app_language_auto, const Locale("auto"): S.current.settings_app_language_auto,
const Locale("zh", "CN"): NoL10n.langZHS, const Locale("zh", "CN"): NoL10n.langZHS,
const Locale("zh", "TW"): NoL10n.langZHT, const Locale("zh", "TW"): NoL10n.langZHT,
const Locale("en"): NoL10n.langEn, const Locale("en"): NoL10n.langEn,
}; };
@override @override
AppGlobalState build() { AppGlobalState build() {

View File

@ -71,7 +71,7 @@ class ToolsUI extends HookConsumerWidget {
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: AlignedGridView.count( child: MasonryGridView.count(
crossAxisCount: 3, crossAxisCount: 3,
mainAxisSpacing: 12, mainAxisSpacing: 12,
crossAxisSpacing: 12, crossAxisSpacing: 12,
@ -93,7 +93,6 @@ class ToolsUI extends HookConsumerWidget {
final item = state.items[index]; final item = state.items[index];
return Container( return Container(
width: 300, width: 300,
height: 200,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: FluentTheme.of(context).cardColor, color: FluentTheme.of(context).cardColor,
@ -125,13 +124,13 @@ class ToolsUI extends HookConsumerWidget {
], ],
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
Expanded( Text(
child: Text(
item.infoString, item.infoString,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Colors.white.withOpacity(.6)), color: Colors.white.withOpacity(.6)),
)), ),
const SizedBox(height: 12),
Row( Row(
children: [ children: [
const Spacer(), const Spacer(),
@ -144,7 +143,11 @@ class ToolsUI extends HookConsumerWidget {
try { try {
item.onTap?.call(); item.onTap?.call();
} catch (e) { } catch (e) {
showToast(context, S.current.tools_info_processing_failed(e)); showToast(
context,
S.current
.tools_info_processing_failed(
e));
} }
}, },
child: const Padding( child: const Padding(
@ -259,4 +262,4 @@ class ToolsUI extends HookConsumerWidget {
], ],
); );
} }
} }