905086
2026-11-08 b1e9aef9d2698cf27eccde2f131eae3c4e6a65d0
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),
@@ -537,6 +544,7 @@
              final installed = _installed ||
                  (t != null &&
                      t.gameId == game!.id &&
                      !t.isTool &&
                      t.finished &&
                      !t.extractFailed);
              return SizedBox(