版本更新展示目标版本号

This commit is contained in:
xkeyC 2023-10-16 23:26:33 +08:00
parent 9a68167062
commit cd68b3086c
2 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,7 @@ class UpgradeDialogUI extends BaseUI<UpgradeDialogUIModel> {
Widget? buildBody(BuildContext context, UpgradeDialogUIModel model) { Widget? buildBody(BuildContext context, UpgradeDialogUIModel model) {
return Material( return Material(
child: ContentDialog( child: ContentDialog(
title: const Text("发现新版本"), title: Text("发现新版本 -> ${model.targetVersion}"),
constraints: constraints:
BoxConstraints(maxWidth: MediaQuery.of(context).size.width * .55), BoxConstraints(maxWidth: MediaQuery.of(context).size.width * .55),
content: Column( content: Column(

View File

@ -7,6 +7,7 @@ import 'package:starcitizen_doctor/common/conf.dart';
class UpgradeDialogUIModel extends BaseUIModel { class UpgradeDialogUIModel extends BaseUIModel {
String? description; String? description;
String targetVersion = "";
String downloadUrl = ""; String downloadUrl = "";
bool isUpgrading = false; bool isUpgrading = false;
@ -17,6 +18,7 @@ class UpgradeDialogUIModel extends BaseUIModel {
Future loadData() async { Future loadData() async {
// get download url for gitlab release // get download url for gitlab release
try { try {
targetVersion = AppConf.networkVersionData!.lastVersion!;
final r = await Api.getAppReleaseDataByVersionName( final r = await Api.getAppReleaseDataByVersionName(
AppConf.networkVersionData!.lastVersion!); AppConf.networkVersionData!.lastVersion!);
description = r["description"]; description = r["description"];