mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-23 03:03:42 +08:00
p4k 下载地址动态下发
This commit is contained in:
parent
4b2461bd9a
commit
889e1f8e19
@ -1,9 +1,10 @@
|
||||
/// lastVersion : "V2.5"
|
||||
/// lastVersionCode : 8
|
||||
/// lastBetaVersion : "V2.5"
|
||||
/// lastBetaVersionCode : 8
|
||||
/// minVersionCode : 7
|
||||
/// minBetaVersionCode : 7
|
||||
/// lastVersion : "V2.9"
|
||||
/// lastVersionCode : 13
|
||||
/// lastBetaVersion : "V2.9"
|
||||
/// lastBetaVersionCode : 13
|
||||
/// minVersionCode : 13
|
||||
/// minBetaVersionCode : 13
|
||||
/// p4kDownloadUrl : "https://p4k.42kit.com/Data.p4k"
|
||||
|
||||
class AppVersionData {
|
||||
AppVersionData({
|
||||
@ -12,7 +13,8 @@ class AppVersionData {
|
||||
this.lastBetaVersion,
|
||||
this.lastBetaVersionCode,
|
||||
this.minVersionCode,
|
||||
this.minBetaVersionCode,});
|
||||
this.minBetaVersionCode,
|
||||
this.p4kDownloadUrl,});
|
||||
|
||||
AppVersionData.fromJson(dynamic json) {
|
||||
lastVersion = json['lastVersion'];
|
||||
@ -21,6 +23,7 @@ class AppVersionData {
|
||||
lastBetaVersionCode = json['lastBetaVersionCode'];
|
||||
minVersionCode = json['minVersionCode'];
|
||||
minBetaVersionCode = json['minBetaVersionCode'];
|
||||
p4kDownloadUrl = json['p4kDownloadUrl'];
|
||||
}
|
||||
String? lastVersion;
|
||||
num? lastVersionCode;
|
||||
@ -28,6 +31,7 @@ class AppVersionData {
|
||||
num? lastBetaVersionCode;
|
||||
num? minVersionCode;
|
||||
num? minBetaVersionCode;
|
||||
String? p4kDownloadUrl;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
@ -37,6 +41,7 @@ class AppVersionData {
|
||||
map['lastBetaVersionCode'] = lastBetaVersionCode;
|
||||
map['minVersionCode'] = minVersionCode;
|
||||
map['minBetaVersionCode'] = minBetaVersionCode;
|
||||
map['p4kDownloadUrl'] = p4kDownloadUrl;
|
||||
return map;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:starcitizen_doctor/base/ui_model.dart';
|
||||
import 'package:starcitizen_doctor/common/conf.dart';
|
||||
import 'package:starcitizen_doctor/common/helper/log_helper.dart';
|
||||
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
||||
import 'package:starcitizen_doctor/ui/tools/downloader/downloader_dialog_ui_model.dart';
|
||||
@ -302,7 +303,15 @@ class ToolsUIModel extends BaseUIModel {
|
||||
}
|
||||
|
||||
Future<void> _downloadP4k() async {
|
||||
const downloadUrl = "https://r2test.citizenwiki.cn/Data.p4k";
|
||||
final downloadUrl = AppConf.networkVersionData?.p4kDownloadUrl;
|
||||
if (downloadUrl == null || downloadUrl.isEmpty) {
|
||||
showToast(context!, "该功能维护中,请稍后再试!");
|
||||
return;
|
||||
}
|
||||
await showToast(
|
||||
context!,
|
||||
"P4k 是星际公民的核心游戏文件,高达近 100GB,盒子提供的离线下载是为了帮助一些p4k文件下载超级慢的用户。"
|
||||
"\n\n接下来会弹窗询问您保存位置(可以选择星际公民文件夹也可以选择别处),下载完成后请确保 P4K 文件夹位于 LIVE 文件夹内,之后使用星际公民启动器校验更新即可。");
|
||||
final r = await showDialog(
|
||||
context: context!,
|
||||
dismissWithEsc: false,
|
||||
|
Loading…
Reference in New Issue
Block a user