feat:riverpod 迁移 Index UI

This commit is contained in:
2024-03-09 20:22:44 +08:00
parent 348d072f6e
commit 6353591935
6 changed files with 174 additions and 14 deletions

View File

@ -143,12 +143,12 @@ class UpgradeDialogUI extends HookConsumerWidget {
Future<void> _getUpdateInfo(
BuildContext context,
targetVersion,
String targetVersion,
ValueNotifier<String?> description,
ValueNotifier<String> downloadUrl) async {
try {
final r = await Api.getAppReleaseDataByVersionName(targetVersion);
description = r["body"];
description.value = r["body"];
final assets = List.of(r["assets"] ?? []);
for (var asset in assets) {
if (asset["name"].toString().endsWith("SETUP.exe")) {
@ -207,6 +207,7 @@ class UpgradeDialogUI extends HookConsumerWidget {
}
if (!context.mounted) return;
_doCancel(context);
return;
}
isUpgrading.value = true;
final fileName = "${appModel.getUpgradePath()}/next_SETUP.exe";