905086
2026-11-04 9593973fb0ff112cf26266bfedbf45e6460b10bf
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),