Browse Source

app自动更新

remove_uniapp
w-R 3 years ago
parent
commit
66763e0e6a
  1. 2
      lib/main_page.dart

2
lib/main_page.dart

@ -337,6 +337,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
BaseData<AppUpdate> baseData = await apiService.appVersion().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
baseData.data.appLastVersion = "1.0.4";
baseData.data.appLastVersionUp = "1.0.1";
if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion)
&& AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){
showDialog(

Loading…
Cancel
Save