/**
* newVersion 新版本号
* old 老版本号
* */
static bool isUpdateVersion(String newVersion, String old) {
if (newVersion == null || newVersion.isEmpty || old == null || old.isEmpty)
return false;
int newVersionInt, oldVersion;
var newList = newVersion.split('.');
var oldList = old.split('.');
if (newList.length == 0 || oldList.length == 0) {
return false;
}
for (int i = 0; i < newList.length; i++) {
newVersionInt = int.parse(newList[i]);
oldVersion = int.parse(oldList[i]);
if (newVersionInt > oldVersion) {
return true;
} else if (newVersionInt < oldVersion) {
return false;
}
}
return false;
}
Flutter APP新版本检测版本号对比
猜你喜欢
转载自blog.csdn.net/wangqing830414/article/details/131152963
今日推荐
周排行