🐛 Fix some bugs

This commit is contained in:
2025-10-10 23:00:13 +08:00
parent fec0cb7640
commit 7dd4b20628
4 changed files with 21 additions and 9 deletions

View File

@@ -1103,6 +1103,9 @@
"openReleasePage": "Open release page", "openReleasePage": "Open release page",
"postCompose": "Compose Post", "postCompose": "Compose Post",
"postPublish": "Publish Post", "postPublish": "Publish Post",
"restoreDraftTitle": "Restore Draft",
"restoreDraftMessage": "A draft was found. Do you want to restore it?",
"draft": "Draft",
"purchaseGift": "Purchase Gift", "purchaseGift": "Purchase Gift",
"selectRecipient": "Select Recipient", "selectRecipient": "Select Recipient",
"changeRecipient": "Change Recipient", "changeRecipient": "Change Recipient",

View File

@@ -1076,5 +1076,10 @@
"recycledFilesDeleted": "被回收文件成功删除", "recycledFilesDeleted": "被回收文件成功删除",
"failedToDeleteRecycledFiles": "删除被回收文件失败", "failedToDeleteRecycledFiles": "删除被回收文件失败",
"upload": "上传", "upload": "上传",
"systemWallet": "中央统筹" "systemWallet": "中央统筹",
} "postCompose": "撰写帖子",
"postPublish": "发布帖子",
"restoreDraftTitle": "恢复草稿",
"restoreDraftMessage": "发现了一个草稿。你想要恢复它吗?",
"draft": "草稿"
}

View File

@@ -1075,5 +1075,7 @@
"deleteRecycledFiles": "刪除已回收檔案", "deleteRecycledFiles": "刪除已回收檔案",
"recycledFilesDeleted": "已回收檔案刪除成功", "recycledFilesDeleted": "已回收檔案刪除成功",
"failedToDeleteRecycledFiles": "已回收檔案刪除失敗", "failedToDeleteRecycledFiles": "已回收檔案刪除失敗",
"upload": "上傳" "upload": "上傳",
} "postCompose": "撰寫帖子",
"postPublish": "發佈帖子"
}

View File

@@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
@@ -86,14 +87,15 @@ class PostComposeDialog extends HookConsumerWidget {
final restore = await showDialog<bool>( final restore = await showDialog<bool>(
context: ref.context, context: ref.context,
useRootNavigator: true,
builder: builder:
(context) => AlertDialog( (context) => AlertDialog(
title: const Text('Restore Draft'), title: Text('restoreDraftTitle'.tr()),
content: Column( content: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const Text('A draft was found. Do you want to restore it?'), Text('restoreDraftMessage'.tr()),
const SizedBox(height: 16), const SizedBox(height: 16),
_buildCompactDraftPreview(context, latestDraft), _buildCompactDraftPreview(context, latestDraft),
], ],
@@ -101,11 +103,11 @@ class PostComposeDialog extends HookConsumerWidget {
actions: [ actions: [
TextButton( TextButton(
onPressed: () => Navigator.of(context).pop(false), onPressed: () => Navigator.of(context).pop(false),
child: const Text('No'), child: Text('no'.tr()),
), ),
TextButton( TextButton(
onPressed: () => Navigator.of(context).pop(true), onPressed: () => Navigator.of(context).pop(true),
child: const Text('Yes'), child: Text('yes'.tr()),
), ),
], ],
), ),
@@ -151,7 +153,7 @@ class PostComposeDialog extends HookConsumerWidget {
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Text( Text(
'Draft', 'draft'.tr(),
style: Theme.of(context).textTheme.labelMedium?.copyWith( style: Theme.of(context).textTheme.labelMedium?.copyWith(
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
), ),