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
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<Locale, String> 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() {

View File

@ -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 {
],
);
}
}
}