Skip to content

Commit

Permalink
fix: late init data error
Browse files Browse the repository at this point in the history
  • Loading branch information
bggRGjQaUbCoE committed Aug 30, 2024
1 parent c88101c commit d9eab8d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/pages/about/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ class AboutController extends GetxController {
final SettingController settingController = Get.put(SettingController());
RxString currentVersion = ''.obs;
RxString remoteVersion = ''.obs;
late LatestDataModel remoteAppInfo;
LatestDataModel? remoteAppInfo;
RxBool isUpdate = true.obs;
RxBool isLoading = true.obs;
late LatestDataModel data;
LatestDataModel? data;
RxInt count = 0.obs;

@override
Expand Down Expand Up @@ -349,15 +349,17 @@ class AboutController extends GetxController {
}
data = LatestDataModel.fromJson(result.data[0]);
remoteAppInfo = data;
remoteVersion.value = data.tagName!;
remoteVersion.value = data!.tagName!;
isUpdate.value =
Utils.needUpdate(currentVersion.value, remoteVersion.value);
isLoading.value = false;
}

// 跳转下载/本地更新
Future onUpdate() async {
Utils.matchVersion(data);
if (data != null) {
Utils.matchVersion(data);
}
}

// 跳转github
Expand Down

0 comments on commit d9eab8d

Please sign in to comment.