Commit 30c92b667e1a2f24ffbf986f755a2f5cd5964991

Authored by wdn127929
1 parent 780da2ac

版本更新 and 登陆页textfield对齐

... ... @@ -11,14 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = "291"
def flutterVersionCode = "266"
if (flutterVersionCode == null) {
flutterVersionCode = '291'
flutterVersionCode = '266'
}
def flutterVersionName = "2.9.1"
def flutterVersionName = "2.6.6"
if (flutterVersionName == null) {
flutterVersionName = '2.9.1'
flutterVersionName = '2.6.6'
}
apply plugin: 'com.android.application'
... ...
... ... @@ -43,9 +43,13 @@ PODS:
- Flutter (1.0.0)
- flutter_app_badger (0.0.1):
- Flutter
- flutter_app_update (0.0.1):
- Flutter
- flutter_bugly (0.0.1):
- Bugly
- Flutter
- flutter_native_image (0.0.1):
- Flutter
- flutter_statusbarcolor (0.0.1):
- Flutter
- fluttertoast (0.0.2):
... ... @@ -71,6 +75,8 @@ PODS:
- photo_manager (0.0.1):
- Flutter
- Reachability (3.2)
- sendsms (0.0.1):
- Flutter
- shared_preferences (0.0.1):
- Flutter
- sign_in_with_apple (0.0.1):
... ... @@ -107,7 +113,9 @@ DEPENDENCIES:
- easy_contact_picker (from `.symlinks/plugins/easy_contact_picker/ios`)
- Flutter (from `Flutter`)
- flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`)
- flutter_app_update (from `.symlinks/plugins/flutter_app_update/ios`)
- flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`)
- flutter_native_image (from `.symlinks/plugins/flutter_native_image/ios`)
- flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
... ... @@ -118,6 +126,7 @@ DEPENDENCIES:
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- photo_manager (from `.symlinks/plugins/photo_manager/ios`)
- sendsms (from `.symlinks/plugins/sendsms/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
... ... @@ -165,8 +174,12 @@ EXTERNAL SOURCES:
:path: Flutter
flutter_app_badger:
:path: ".symlinks/plugins/flutter_app_badger/ios"
flutter_app_update:
:path: ".symlinks/plugins/flutter_app_update/ios"
flutter_bugly:
:path: ".symlinks/plugins/flutter_bugly/ios"
flutter_native_image:
:path: ".symlinks/plugins/flutter_native_image/ios"
flutter_statusbarcolor:
:path: ".symlinks/plugins/flutter_statusbarcolor/ios"
fluttertoast:
... ... @@ -187,6 +200,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/permission_handler/ios"
photo_manager:
:path: ".symlinks/plugins/photo_manager/ios"
sendsms:
:path: ".symlinks/plugins/sendsms/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
sign_in_with_apple:
... ... @@ -224,7 +239,9 @@ SPEC CHECKSUMS:
easy_contact_picker: 9ab9dc70e8ddde6e76a19ffc482d7bf899868730
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
flutter_app_badger: 65de4d6f0c34a891df49e6cfb8a1c0496426fa68
flutter_app_update: 65f61da626cb111d1b24674abc4b01728d7723bc
flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3
flutter_native_image: 9c0b7451838484458e5b0fae007b86a4c2d4bdfe
flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
... ... @@ -237,6 +254,7 @@ SPEC CHECKSUMS:
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
photo_manager: f7c619c2cc8c2adb8d85c63363babac477de9c67
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
sendsms: 4065f76018b22a3e6987b4630f161feab95cef23
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
sign_in_with_apple: 34f3f5456a45fd7ac5fb42905e2ad31dae061b4a
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
... ...
... ... @@ -308,6 +308,8 @@
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
"${BUILT_PRODUCTS_DIR}/easy_contact_picker/easy_contact_picker.framework",
"${BUILT_PRODUCTS_DIR}/flutter_app_badger/flutter_app_badger.framework",
"${BUILT_PRODUCTS_DIR}/flutter_app_update/flutter_app_update.framework",
"${BUILT_PRODUCTS_DIR}/flutter_native_image/flutter_native_image.framework",
"${BUILT_PRODUCTS_DIR}/flutter_statusbarcolor/flutter_statusbarcolor.framework",
"${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework",
"${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework",
... ... @@ -315,6 +317,7 @@
"${BUILT_PRODUCTS_DIR}/package_info/package_info.framework",
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
"${BUILT_PRODUCTS_DIR}/photo_manager/photo_manager.framework",
"${BUILT_PRODUCTS_DIR}/sendsms/sendsms.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
"${BUILT_PRODUCTS_DIR}/sign_in_with_apple/sign_in_with_apple.framework",
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
... ... @@ -334,6 +337,8 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/easy_contact_picker.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_badger.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_update.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_native_image.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_statusbarcolor.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework",
... ... @@ -341,6 +346,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/photo_manager.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sendsms.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sign_in_with_apple.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
... ... @@ -473,10 +479,10 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 279;
CURRENT_PROJECT_VERSION = 260;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
FLUTTER_BUILD_MODE = debug;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
... ... @@ -488,7 +494,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.6.6;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -618,10 +624,10 @@
CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 279;
CURRENT_PROJECT_VERSION = 260;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
FLUTTER_BUILD_MODE = debug;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
... ... @@ -633,7 +639,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.6.6;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -653,7 +659,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 279;
CURRENT_PROJECT_VERSION = 260;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -668,7 +674,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.6.6;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = "";
... ...
... ... @@ -1122,7 +1122,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
} else {
fullName = contact.fullName;
}
_notebookDetailChangeModel.phoneController.text = contact.phoneNumber;
_notebookDetailChangeModel.phoneController.text =
contact.phoneNumber.replaceAll(new RegExp(r"\s+"), "");
// _notebookDetailChangeModel.nameController.text = fullName;
nameStr = fullName;
_addNameSuffix(fullName, _nameSuffix());
... ...
... ... @@ -4,6 +4,7 @@ import 'dart:io';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app_update/azhon_app_update.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/app.dart';
import 'package:one_key/pages/home_enter_order/home_enter_order.dart';
... ... @@ -59,12 +60,17 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
DateTime lastBack;
PageController _pageController;
bool needUpdate = true;
@override
void initState() {
// TODO: implement initState
super.initState();
LogUtil.v("home_initState");
AzhonAppUpdate.listener((map) {
needUpdate = false;
print(map['type']);
});
WidgetsBinding.instance.addObserver(this);
_currIndex = widget.initialIndex;
_pageController = PageController(initialPage: _currIndex);
... ... @@ -100,8 +106,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
_getIntent();
Future.delayed(Duration(milliseconds: 30000), () {
ContactModel.getInstance().uploadLocalContact(context);
UpdateModel updateModel = new UpdateModel();
updateModel.checkUpdate(context, showToast: false);
if (needUpdate) {
UpdateModelMy updateModel = new UpdateModelMy();
updateModel.checkUpdate(context, (version) {
updateModel.showUpdateDialog(context, version);
}, showToast: false);
}
});
timer = Timer.periodic(Duration(minutes: 3), (_) {
_getAllUnMessages();
... ... @@ -447,8 +457,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
bool _getUnMsgNum() {
MessageModel messageModel =
Provider.of<MessageModel>(context, listen: true);
if (
messageModel.onlineTotal +
if (messageModel.onlineTotal +
messageModel.orderTotal +
messageModel.checkTotal >
0) {
... ...
... ... @@ -1313,7 +1313,8 @@ class _HomeEnterPageState extends State<HomeEnterPage>
} else {
fullName = contact.fullName;
}
_homeEnterModel.phoneController.text = contact.phoneNumber;
_homeEnterModel.phoneController.text =
contact.phoneNumber.replaceAll(new RegExp(r"\s+"), "");
nameStr = fullName;
// _homeEnterModel.nameController.text = fullName + _nameSuffix();
_addNameSuffix(fullName, _nameSuffix());
... ...
... ... @@ -114,8 +114,6 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
super.didChangeDependencies();
}
//监听输入框,设置登录按钮状态
setActivate() {
if (_sellerCodeController.text.isNotEmpty &&
... ... @@ -418,40 +416,48 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
width: prefixIconWidth,
),
HEmptyView(26),
Text(
Center(
child: Text(
"商户编号",
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(28)),
),
)),
Expanded(
child: TextField(
controller: _sellerCodeController,
focusNode: _sellerCodeFocusNode,
// autofocus: _sellerCodeController.text.isEmpty,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(28),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
hintText: "请输入6位商户编码",
hintStyle: TextStyle(
color: MyColours.color_c1c1c1,
fontSize: ScreenUtil().setSp(28),
),
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(
horizontal: 10, vertical: 14),
),
onChanged: (_) {
setActivate();
},
keyboardType: TextInputType.number,
),
child: Container(
height: ScreenUtil().setHeight(84),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(20),
right: ScreenUtil().setWidth(20),
top: ScreenUtil().setWidth(8)),
child: TextField(
controller: _sellerCodeController,
focusNode: _sellerCodeFocusNode,
// autofocus: _sellerCodeController.text.isEmpty,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(28),
textBaseline: TextBaseline.alphabetic),
// textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
hintText: "请输入6位商户编码",
hintStyle: TextStyle(
color: MyColours.color_c1c1c1,
fontSize: ScreenUtil().setSp(28),
),
border: OutlineInputBorder(
borderSide: BorderSide.none),
contentPadding: EdgeInsets.zero,
),
onChanged: (_) {
setActivate();
},
keyboardType: TextInputType.number,
)),
)
],
)),
Container(
height: ScreenUtil().setHeight(84),
width: ScreenUtil().setWidth(611),
... ... @@ -479,6 +485,12 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
fontSize: ScreenUtil().setSp(28)),
),
Expanded(
child: Container(
height: ScreenUtil().setHeight(84),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(20),
right: ScreenUtil().setWidth(20),
top: ScreenUtil().setWidth(8)),
child: TextField(
controller: _accountController,
focusNode: _accountFocusNode,
... ... @@ -490,16 +502,16 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
hintStyle: TextStyle(
color: MyColours.color_c1c1c1,
fontSize: ScreenUtil().setSp(28)),
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(
horizontal: 10, vertical: 14),
border: OutlineInputBorder(
borderSide: BorderSide.none),
contentPadding: EdgeInsets.zero,
),
onChanged: (_) {
setActivate();
},
keyboardType: TextInputType.number,
),
)
))
],
)),
Container(
... ... @@ -531,30 +543,36 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
fontSize: ScreenUtil().setSp(28)),
),
Expanded(
child: TextField(
controller: _pwdController,
focusNode: _pwdFocusNode,
// autofocus: _sellerCodeController.text.isNotEmpty &&
// _accountController.text.isNotEmpty &&
// _pwdController.text.isEmpty,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(28)),
decoration: InputDecoration(
hintText: "请输入密码",
hintStyle: TextStyle(
color: MyColours.color_c1c1c1,
fontSize: ScreenUtil().setSp(28)),
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(
horizontal: 10, vertical: 14),
),
onChanged: (_) {
setActivate();
},
obscureText: obscureText,
keyboardType: TextInputType.text,
),
child: Container(
height: ScreenUtil().setHeight(84),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(20),
right: ScreenUtil().setWidth(20),
top: ScreenUtil().setWidth(8)),
child: TextField(
controller: _pwdController,
focusNode: _pwdFocusNode,
// autofocus: _sellerCodeController.text.isNotEmpty &&
// _accountController.text.isNotEmpty &&
// _pwdController.text.isEmpty,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(28)),
decoration: InputDecoration(
hintText: "请输入密码",
hintStyle: TextStyle(
color: MyColours.color_c1c1c1,
fontSize: ScreenUtil().setSp(28)),
border: OutlineInputBorder(
borderSide: BorderSide.none),
contentPadding: EdgeInsets.zero,
),
onChanged: (_) {
setActivate();
},
obscureText: obscureText,
keyboardType: TextInputType.text,
)),
),
GestureDetector(
child: Padding(
... ... @@ -575,6 +593,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
)
],
)),
Container(
width: ScreenUtil().setWidth(611),
margin: EdgeInsets.only(top: ScreenUtil().setHeight(16)),
... ...
... ... @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluwx/fluwx.dart';
import 'package:one_key/models/sms_info.dart';
import 'package:one_key/models/version.dart';
import 'package:one_key/provider/my_model.dart';
import 'package:one_key/provider/update_model.dart';
import 'package:one_key/provider/user_model.dart';
... ... @@ -32,6 +33,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
bool newVersion = false;
MyModel myModel;
ScrollController controller;
Version _version;
@override
void initState() {
... ... @@ -49,9 +51,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
WidgetsBinding.instance.addPostFrameCallback((_) async {
///获取短信余量
_getSmsInfo(context);
_getMyIntegral(context);
///获取积分
_getMyIntegral(context);
///apk版本检测
checkUpdate();
});
EventBus().on('changeStatusColor', (arg) {
Utils.changeStatusColor(color: MyColours.color_199095);
... ... @@ -106,8 +111,14 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
//检查版本更新
checkUpdate() {
UpdateModel updateModel = new UpdateModel();
updateModel.checkUpdate(context);
UpdateModelMy updateModel = new UpdateModelMy();
updateModel.checkUpdate(context, (version) {
_version = version;
setState(() {
newVersion = true;
});
// updateModel.showUpdateDialog(context, version);
});
}
@override
... ... @@ -372,7 +383,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
MyDivider(double.infinity, ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3),
GestureDetector(
onTap: checkUpdate,
onTap: () {
if (newVersion) {
UpdateModelMy updateModel = new UpdateModelMy();
updateModel.showUpdateDialog(context, _version);
}
},
child: Container(
width: double.infinity,
height: ScreenUtil().setHeight(122),
... ... @@ -391,7 +407,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Spacer(),
newVersion
? Container(
width: ScreenUtil().setWidth(120),
// width: ScreenUtil().setWidth(120),
height: ScreenUtil().setWidth(34),
decoration: BoxDecoration(
color: MyColours.color_E14553,
... ... @@ -399,14 +415,17 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Radius.circular(
ScreenUtil().setWidth(6))),
),
child: Center(
child: Text(
"发现新版本",
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_ffffff),
),
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(8)),
child: Center(
child: Text(
"发现新版本",
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_ffffff),
),
)),
)
: Text(
cur_version,
... ...
... ... @@ -17,18 +17,52 @@ import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:ota_update/ota_update.dart';
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:flutter_app_update/azhon_app_update.dart';
import 'package:flutter_app_update/update_model.dart';
class UpdateModel {
typedef VeisonCallback = void Function(Version value);
class UpdateModelMy {
int _progress = 1; //下载进度
Function _setState;
Future<void> tryOtaUpdate(String url) async {
try {
OtaUpdate().execute(url, destinationFilename: '周到安排.apk').listen(
(OtaEvent event) {
// setState(() => currentEvent = event);
// if(event)
print('${event.status} : ${event.value}');
},
);
} catch (e) {
print('Failed to make OTA update. Details: $e');
}
}
///简单使用
simpleUse(bool showiOSDialog, String url) {
UpdateModel model = UpdateModel(
url,
"yjd.apk",
"ic_launcher",
"1.支持Android M N O P Q\n2.支持自定义下载过程\n3.支持 设备>=Android M 动态权限的申请\n4.支持通知栏进度条展示\n5.支持文字国际化",
iOSUrl: 'itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1510697490',
showiOSDialog: showiOSDialog,
);
AzhonAppUpdate.update(model).then((value) => print(value));
}
//检查更新
checkUpdate(BuildContext context, {showToast = true}) async {
checkUpdate(BuildContext context, VeisonCallback callback,
{showToast = true}) async {
String deviceId = await Utils.getUUID();
UserModel userModel = Provider.of<UserModel>(context, listen: false);
int versionCode = await Utils.getCurrBuildNum();
int versionCode = await AzhonAppUpdate.getVersionCode;
String make = "3";
if (Platform.isIOS) make = "4";
Map<String, String> params = {
... ... @@ -57,7 +91,7 @@ class UpdateModel {
"file_url": dataMap["file_url"].toString(),
"content": dataMap["content"].toString()
});
showUpdateDialog(context, version);
callback(version);
} else {
if (showToast) {
Utils.showToast(baseResp?.msg ?? "当前已是最新版本");
... ... @@ -151,10 +185,16 @@ class UpdateModel {
Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context).pop();
if (Platform.isAndroid) {
downloadApk(pageContext, version.file_url);
// 原来的更新
// downloadApk(pageContext, version.file_url);
//新的更新
// tryOtaUpdate(version.file_url);
simpleUse(false, version.file_url);
Navigator.of(context).pop();
} else {
Navigator.of(context).pop();
InstallPlugin.gotoAppStore(
"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1510697490");
}
... ...
... ... @@ -356,6 +356,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
flutter_app_update:
dependency: "direct main"
description:
name: flutter_app_update
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
flutter_blurhash:
dependency: transitive
description:
... ... @@ -506,6 +513,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
in_app_update:
dependency: "direct main"
description:
name: in_app_update
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
install_plugin:
dependency: "direct main"
description:
... ... @@ -611,6 +625,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
ota_update:
dependency: "direct main"
description:
name: ota_update
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.1"
package_config:
dependency: transitive
description:
... ...
... ... @@ -120,6 +120,9 @@ dependencies:
lpinyin: ^2.0.3
#图片压缩
flutter_native_image: ^0.0.6+1
#更新apk
ota_update: ^3.1.1
flutter_app_update: ^1.0.2
sendsms:
path: library/sendsms-1.0.3
... ...