| | |
| | | Future<void> _launchGame(DownloadTask task) async { |
| | | final ok = await launchInstalledGame(task.title, task.launchExe); |
| | | if (!ok && mounted) { |
| | | _toast('未找到游戏文件,请重新下载安装'); |
| | | _toast(task.isTool ? '未找到工具文件,请重新下载安装' : '未找到游戏文件,请重新下载安装'); |
| | | } |
| | | } |
| | | |
| | |
| | | padding: const EdgeInsets.symmetric(vertical: 12), |
| | | ), |
| | | child: (task.finished && !task.extractFailed) |
| | | ? const Row( |
| | | ? Row( |
| | | mainAxisAlignment: MainAxisAlignment.center, |
| | | children: [ |
| | | Icon(Icons.play_arrow, size: 18), |
| | | SizedBox(width: 8), |
| | | Text('启动游戏', |
| | | style: TextStyle(fontSize: 14)), |
| | | const Icon(Icons.play_arrow, size: 18), |
| | | const SizedBox(width: 8), |
| | | Text(task.isTool ? '启动' : '启动游戏', |
| | | style: const TextStyle(fontSize: 14)), |
| | | ], |
| | | ) |
| | | : const Text('取消安装'), |