|
...
|
...
|
@@ -29,10 +29,14 @@ class UpdateModel { |
|
|
|
String deviceId = await Utils.getUUID();
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
int versionCode = await Utils.getCurrBuildNum();
|
|
|
|
String make="3";
|
|
|
|
if(Platform.isIOS)make="4";
|
|
|
|
Map<String, String> params = {
|
|
|
|
"deviceId": deviceId,
|
|
|
|
"sid": userModel.user.sellerid,
|
|
|
|
"versionCode": versionCode.toString()
|
|
|
|
"versionCode": versionCode.toString(),
|
|
|
|
"flag":"4",
|
|
|
|
"make":make,//3 android 4 ios
|
|
|
|
};
|
|
|
|
BaseResp<List> baseResp = await DioUtil()
|
|
|
|
.request<List>(context, Method.get, HttpUrl.check_update, data: params)
|
|
...
|
...
|
@@ -41,12 +45,13 @@ class UpdateModel { |
|
|
|
});
|
|
|
|
if (baseResp.code == Constant.status_success) {
|
|
|
|
LogUtil.v(baseResp.data);
|
|
|
|
Map<String, String> dataMap = baseResp.data[0];
|
|
|
|
if (int.parse(dataMap["version"]) > versionCode) {
|
|
|
|
Map<String, dynamic> dataMap = baseResp.data[0];
|
|
|
|
if (int.parse(dataMap["version"].toString()) > versionCode) {
|
|
|
|
Version version = Version.fromJson({
|
|
|
|
"version": dataMap["versionName"],
|
|
|
|
"file_url":dataMap["file_url"],
|
|
|
|
"content": dataMap["content"]
|
|
|
|
"name":dataMap["name"].toString(),
|
|
|
|
"version": dataMap["version"].toString(),
|
|
|
|
"file_url":dataMap["file_url"].toString(),
|
|
|
|
"content": dataMap["content"].toString()
|
|
|
|
});
|
|
|
|
showUpdateDialog(context, version);
|
|
|
|
}
|
|
...
|
...
|
@@ -93,7 +98,7 @@ class UpdateModel { |
|
|
|
children: <Widget>[
|
|
|
|
Center(
|
|
|
|
child: Text(
|
|
|
|
"${version.version}版本更新啦",
|
|
|
|
"${version.name}版本更新啦",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(36),
|
|
|
|
color: MyColours.color_353535),
|
...
|
...
|
|