From 7fd2270570811c0d29f0d5d87d11bfc4612e0743 Mon Sep 17 00:00:00 2001
From: 905086 <k2049@qq.com>
Date: Sat, 07 Nov 2026 20:30:06 +0800
Subject: [PATCH] feat: 实现用户密码找回功能及相关配套功能

---
 fluttergamebox/lib/pages/detail_page.dart |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/fluttergamebox/lib/pages/detail_page.dart b/fluttergamebox/lib/pages/detail_page.dart
index cf4a0d3..3031f6b 100644
--- a/fluttergamebox/lib/pages/detail_page.dart
+++ b/fluttergamebox/lib/pages/detail_page.dart
@@ -72,6 +72,8 @@
     final res = await ApiService.toggleFavorite(widget.gameId);
     if (res['code'] == 0 && mounted) {
       setState(() => isFavorite = !isFavorite);
+      // 通知收藏页实时刷新
+      AppState.instance.bumpFavorites();
       _toast(res['msg'] ?? '操作成功');
     }
   }
@@ -80,6 +82,8 @@
     final res = await ApiService.addToLibrary(widget.gameId);
     if (res['code'] == 0 && mounted) {
       setState(() => inLibrary = true);
+      // 通知资源库页实时刷新
+      AppState.instance.bumpLibrary();
       _showConfirmDialog(
           '兑换成功!', '游戏已加入资源库,请在资源库页面查看。');
     } else if (mounted) {
@@ -111,11 +115,14 @@
     }
   }
 
-  /// 下载前选择下载安装路径
+  /// 下载前选择下载安装路径(并校验磁盘剩余空间)
   Future<bool> _askDownloadPath() async {
     final result = await showDialog<bool>(
       context: context,
-      builder: (context) => DownloadPathDialog(gameTitle: game!.title),
+      builder: (context) => DownloadPathDialog(
+        gameTitle: game!.title,
+        requiredGb: game!.requiredDiskGb,
+      ),
     );
     return result == true;
   }
@@ -487,8 +494,8 @@
             ],
           ),
           const SizedBox(height: 18),
-          _infoRow('游戏大小', game!.size),
-          _infoRow('磁盘占用', game!.installSize),
+          _infoRow('游戏大小', sizeWithGb(game!.size)),
+          _infoRow('磁盘占用', sizeWithGb(game!.installSize)),
           const Divider(color: AppColors.bgLighter, height: 28),
           _infoRow('操作系统', game!.osReq),
           _infoRow('CPU', game!.cpuReq),

--
Gitblit v1.10.0