From 9593973fb0ff112cf26266bfedbf45e6460b10bf Mon Sep 17 00:00:00 2001
From: 905086 <k2049@qq.com>
Date: Wed, 04 Nov 2026 20:43:12 +0800
Subject: [PATCH] feat: 支持游戏启动程序配置与自动解压安装

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

diff --git a/fluttergamebox/lib/pages/detail_page.dart b/fluttergamebox/lib/pages/detail_page.dart
index f538ae3..cee38dd 100644
--- a/fluttergamebox/lib/pages/detail_page.dart
+++ b/fluttergamebox/lib/pages/detail_page.dart
@@ -86,13 +86,9 @@
 
   Future<void> _download() async {
     if (game == null) return;
-    // 检查下载路径
-    var dlPath = await AppPrefs.getDownloadPath();
-    if (dlPath.isEmpty) {
-      final ok = await _askDownloadPath();
-      if (!ok) return;
-      dlPath = await AppPrefs.getDownloadPath();
-    }
+    // 每次下载前都弹出选择下载安装路径
+    final ok = await _askDownloadPath();
+    if (!ok) return;
     // 会员校验+开始下载
     try {
       await DownloadManager.instance.startDownload(game!);
@@ -103,13 +99,8 @@
     }
   }
 
-  /// 首次下载询问下载路径
+  /// 下载前选择下载安装路径
   Future<bool> _askDownloadPath() async {
-    final res = await ApiService.downloadInfo(widget.gameId);
-    if (res['code'] != 0) {
-      if (mounted) _toast(res['msg'] ?? '无法下载', error: true);
-      return false;
-    }
     final result = await showDialog<bool>(
       context: context,
       builder: (context) => _DownloadPathDialog(gameTitle: game!.title),

--
Gitblit v1.10.0