feat: 关于页面

This commit is contained in:
guozhigq
2023-08-17 09:43:01 +08:00
parent 96037e0885
commit eababaad74
10 changed files with 366 additions and 3 deletions

View File

@ -178,4 +178,20 @@ class Utils {
} catch (_) {}
return closestNumber;
}
// 版本对比
static bool needUpdate(localVersion, remoteVersion) {
List<String> localVersionList = localVersion.split('.');
List<String> remoteVersionList = remoteVersion.split('v')[1].split('.');
for (int i = 0; i < localVersionList.length; i++) {
int localVersion = int.parse(localVersionList[i]);
int remoteVersion = int.parse(remoteVersionList[i]);
if (remoteVersion > localVersion) {
return true;
} else if (remoteVersion < localVersion) {
return false;
}
}
return false;
}
}