1、完成版本更新功能。2、根据最新协议完成添加锁时添加密码为管理员密码功能
This commit is contained in:
parent
f71269fb3d
commit
41f745b41b
@ -27,6 +27,8 @@ PODS:
|
|||||||
- AMapFoundation (1.8.2)
|
- AMapFoundation (1.8.2)
|
||||||
- AMapLocation (2.10.0):
|
- AMapLocation (2.10.0):
|
||||||
- AMapFoundation (>= 1.8.0)
|
- AMapFoundation (>= 1.8.0)
|
||||||
|
- audio_service (0.0.1):
|
||||||
|
- Flutter
|
||||||
- audio_session (0.0.1):
|
- audio_session (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- audioplayers_darwin (0.0.1):
|
- audioplayers_darwin (0.0.1):
|
||||||
@ -107,6 +109,7 @@ DEPENDENCIES:
|
|||||||
- aliyun_push (from `.symlinks/plugins/aliyun_push/ios`)
|
- aliyun_push (from `.symlinks/plugins/aliyun_push/ios`)
|
||||||
- amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`)
|
- amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`)
|
||||||
- amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`)
|
- amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`)
|
||||||
|
- audio_service (from `.symlinks/plugins/audio_service/ios`)
|
||||||
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
||||||
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
|
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
|
||||||
- auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
|
- auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
|
||||||
@ -163,6 +166,8 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/amap_flutter_location/ios"
|
:path: ".symlinks/plugins/amap_flutter_location/ios"
|
||||||
amap_flutter_map:
|
amap_flutter_map:
|
||||||
:path: ".symlinks/plugins/amap_flutter_map/ios"
|
:path: ".symlinks/plugins/amap_flutter_map/ios"
|
||||||
|
audio_service:
|
||||||
|
:path: ".symlinks/plugins/audio_service/ios"
|
||||||
audio_session:
|
audio_session:
|
||||||
:path: ".symlinks/plugins/audio_session/ios"
|
:path: ".symlinks/plugins/audio_session/ios"
|
||||||
audioplayers_darwin:
|
audioplayers_darwin:
|
||||||
@ -231,6 +236,7 @@ SPEC CHECKSUMS:
|
|||||||
amap_flutter_map: 979e54d227cedac6c7504a2151bfbf3bcf96760a
|
amap_flutter_map: 979e54d227cedac6c7504a2151bfbf3bcf96760a
|
||||||
AMapFoundation: 9885c48fc3a78fdfb84a0299a2293e56ea3c9fec
|
AMapFoundation: 9885c48fc3a78fdfb84a0299a2293e56ea3c9fec
|
||||||
AMapLocation: 5248aec2455ebb5d104b367813c946430a2ee033
|
AMapLocation: 5248aec2455ebb5d104b367813c946430a2ee033
|
||||||
|
audio_service: f509d65da41b9521a61f1c404dd58651f265a567
|
||||||
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
|
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
|
||||||
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
|
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
|
||||||
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
||||||
|
|||||||
@ -13,10 +13,11 @@ import 'package:star_lock/translations/trans_lib.dart';
|
|||||||
|
|
||||||
import 'appRouters.dart';
|
import 'appRouters.dart';
|
||||||
import 'baseWidget.dart';
|
import 'baseWidget.dart';
|
||||||
import 'network/api_repository.dart';
|
|
||||||
import 'tools/appRouteObserver.dart';
|
import 'tools/appRouteObserver.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'versionUndate/versionUndateTool.dart';
|
||||||
|
|
||||||
class MyApp extends StatefulWidget {
|
class MyApp extends StatefulWidget {
|
||||||
const MyApp({GlobalKey? key}) : super(key: key);
|
const MyApp({GlobalKey? key}) : super(key: key);
|
||||||
|
|
||||||
@ -100,7 +101,6 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
|||||||
super.initState();
|
super.initState();
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
|
||||||
// openBlueScan();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -10,6 +10,8 @@ import 'app_settings/app_settings.dart';
|
|||||||
import 'tools/store_service.dart';
|
import 'tools/store_service.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import 'versionUndate/versionUndateTool.dart';
|
||||||
|
|
||||||
// 该文件不可作为编译入口,请查看 flavorizr.yaml 中的说明
|
// 该文件不可作为编译入口,请查看 flavorizr.yaml 中的说明
|
||||||
FutureOr<void> main() async {
|
FutureOr<void> main() async {
|
||||||
await _setCommonServices();
|
await _setCommonServices();
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import '../../../network/api_repository.dart';
|
|||||||
import '../../../talk/udp/udp_help.dart';
|
import '../../../talk/udp/udp_help.dart';
|
||||||
import '../../../tools/baseGetXController.dart';
|
import '../../../tools/baseGetXController.dart';
|
||||||
import '../../../tools/eventBusEventManage.dart';
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../versionUndate/versionUndateTool.dart';
|
||||||
import '../entity/lockListInfo_entity.dart';
|
import '../entity/lockListInfo_entity.dart';
|
||||||
import 'lockMain_state.dart';
|
import 'lockMain_state.dart';
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ class _AboutPageState extends State<AboutPage> {
|
|||||||
packageName = packageInfo.packageName;
|
packageName = packageInfo.packageName;
|
||||||
version = packageInfo.version;
|
version = packageInfo.version;
|
||||||
buildNumber = packageInfo.buildNumber;
|
buildNumber = packageInfo.buildNumber;
|
||||||
|
print("aboutGetversion:${version}");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
IoSenderManage.senderCustomPasswordsCommand(
|
IoSenderManage.senderCustomPasswordsCommand(
|
||||||
keyID: "1",
|
keyID: "1",
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
pwdNo: 1,
|
pwdNo: 254,
|
||||||
pwd: "123456",
|
pwd: "123456",
|
||||||
useCountLimit: 0xff,
|
useCountLimit: 0xff,
|
||||||
startTime: 0x11223344,
|
startTime: 0x11223344,
|
||||||
@ -197,7 +197,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
IoSenderManage.changeAdministratorPasswordCommand(
|
IoSenderManage.changeAdministratorPasswordCommand(
|
||||||
keyID: "1",
|
keyID: "1",
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
pwdNo: 0,
|
pwdNo: 254,
|
||||||
pwd:state.adminPasswordTF.text,
|
pwd:state.adminPasswordTF.text,
|
||||||
useCountLimit: 0xff,
|
useCountLimit: 0xff,
|
||||||
startTime: 0x11223344,
|
startTime: 0x11223344,
|
||||||
@ -300,7 +300,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
IoSenderManage.senderCustomPasswordsCommand(
|
IoSenderManage.senderCustomPasswordsCommand(
|
||||||
keyID: "1",
|
keyID: "1",
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
pwdNo: 1,
|
pwdNo: 254,
|
||||||
pwd:state.adminPasswordTF.text,
|
pwd:state.adminPasswordTF.text,
|
||||||
useCountLimit: 0xff,
|
useCountLimit: 0xff,
|
||||||
startTime: 0x11223344,
|
startTime: 0x11223344,
|
||||||
@ -334,7 +334,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
IoSenderManage.changeAdministratorPasswordCommand(
|
IoSenderManage.changeAdministratorPasswordCommand(
|
||||||
keyID: "1",
|
keyID: "1",
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
pwdNo: 0,
|
pwdNo: 254,
|
||||||
pwd:state.adminPasswordTF.text,
|
pwd:state.adminPasswordTF.text,
|
||||||
useCountLimit: 0xff,
|
useCountLimit: 0xff,
|
||||||
startTime: 0x11223344,
|
startTime: 0x11223344,
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
|||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
import '../main/lockMian/lockMain/lockMain_page.dart';
|
import '../main/lockMian/lockMain/lockMain_page.dart';
|
||||||
|
import '../versionUndate/versionUndateTool.dart';
|
||||||
|
|
||||||
class StarLockApplication extends StatefulWidget {
|
class StarLockApplication extends StatefulWidget {
|
||||||
const StarLockApplication({Key? key}) : super(key: key);
|
const StarLockApplication({Key? key}) : super(key: key);
|
||||||
@ -13,10 +14,20 @@ class StarLockApplication extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _StarLockApplicationState extends State<StarLockApplication> {
|
class _StarLockApplicationState extends State<StarLockApplication> {
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
// TODO: implement initState
|
||||||
|
super.initState();
|
||||||
|
print("StarLockApplication initState");
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
print("StarLockApplication build");
|
||||||
AppFirstEnterHandle().getAppFirstEnter(context, isAgreePrivacy);
|
AppFirstEnterHandle().getAppFirstEnter(context, isAgreePrivacy);
|
||||||
|
AppFirstEnterHandle().getAppFirstEnter(context, isShowUpdateVersion);
|
||||||
return FutureBuilder<bool>(
|
return FutureBuilder<bool>(
|
||||||
future: getLoginStatus(),
|
future: getLoginStatus(),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
|||||||
@ -1,13 +1,21 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
|
import '../network/api_repository.dart';
|
||||||
|
import '../translations/trans_lib.dart';
|
||||||
|
import '../versionUndate/versionUndateTool.dart';
|
||||||
|
import '../versionUndate/versionUndate_entity.dart';
|
||||||
|
|
||||||
class AppFirstEnterHandle {
|
class AppFirstEnterHandle {
|
||||||
Future getAppFirstEnter(BuildContext widgetContext, String flagStr) async {
|
Future getAppFirstEnter(BuildContext widgetContext, String flagStr) async {
|
||||||
var getFlag = await Storage.getString(flagStr);
|
var getFlag = await Storage.getString(flagStr);
|
||||||
@ -28,6 +36,11 @@ class AppFirstEnterHandle {
|
|||||||
if (getFlag != isAgreeCamera) showCameraAlert(widgetContext);
|
if (getFlag != isAgreeCamera) showCameraAlert(widgetContext);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case isShowUpdateVersion: // 版本更新
|
||||||
|
{
|
||||||
|
if (getFlag != isShowUpdateVersion) VersionUndateTool();
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
print('没有匹配的flagStr');
|
print('没有匹配的flagStr');
|
||||||
|
|||||||
@ -19,6 +19,8 @@ const isAgreePrivacy = "isAgreePrivacy"; //是否同意隐私协议弹窗
|
|||||||
const isAgreePosition = "isAgreePosition"; //是否同意获取位置弹窗
|
const isAgreePosition = "isAgreePosition"; //是否同意获取位置弹窗
|
||||||
const isAgreeCamera = "isAgreeCamera"; //是否同意获取相机/相册弹窗
|
const isAgreeCamera = "isAgreeCamera"; //是否同意获取相机/相册弹窗
|
||||||
|
|
||||||
|
const isShowUpdateVersion = "isShowUpdateVersion"; //是否更新弹窗
|
||||||
|
|
||||||
const saveUserLoginData = "userLoginData";
|
const saveUserLoginData = "userLoginData";
|
||||||
|
|
||||||
class Storage {
|
class Storage {
|
||||||
|
|||||||
133
star_lock/lib/versionUndate/versionUndateTool.dart
Normal file
133
star_lock/lib/versionUndate/versionUndateTool.dart
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
import '../network/api_repository.dart';
|
||||||
|
import '../tools/storage.dart';
|
||||||
|
import '../translations/trans_lib.dart';
|
||||||
|
import 'versionUndate_entity.dart';
|
||||||
|
|
||||||
|
class VersionUndateTool {
|
||||||
|
static VersionUndateTool? _manager;
|
||||||
|
|
||||||
|
VersionUndateTool._init(){
|
||||||
|
// _initLoadUpdateVersionData();
|
||||||
|
}
|
||||||
|
|
||||||
|
static VersionUndateTool? shareManager() {
|
||||||
|
_manager ??= VersionUndateTool._init();
|
||||||
|
_manager!._initLoadUpdateVersionData();
|
||||||
|
return _manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
factory VersionUndateTool() => shareManager()!;
|
||||||
|
|
||||||
|
VersionUndateTool? get manager => shareManager();
|
||||||
|
|
||||||
|
void _initLoadUpdateVersionData() {
|
||||||
|
|
||||||
|
getVersionData();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取版本号
|
||||||
|
void getVersionData() async {
|
||||||
|
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
||||||
|
String brandName = '';
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
||||||
|
Get.log('androidInfo.manufacturer:${androidInfo.manufacturer}'
|
||||||
|
'androidInfo.device:${androidInfo.device}'
|
||||||
|
'androidInfo.model:${androidInfo.model}'
|
||||||
|
'androidInfo.product:${androidInfo.product}'
|
||||||
|
'androidInfo.version.release:${androidInfo.version.release}'
|
||||||
|
'androidInfo.version.sdkInt:${androidInfo.version.sdkInt}'
|
||||||
|
'androidInfo.version.securityPatch:${androidInfo.version.securityPatch}'
|
||||||
|
'androidInfo.version.incremental:${androidInfo.version.incremental}'
|
||||||
|
'androidInfo.version.codename:${androidInfo.version.codename}'
|
||||||
|
'androidInfo.version.baseOS:${androidInfo.version.baseOS}'
|
||||||
|
'androidInfo.board:${androidInfo.board}'
|
||||||
|
'androidInfo.bootloader:${androidInfo.bootloader}');
|
||||||
|
brandName = androidInfo.manufacturer;
|
||||||
|
} else if (Platform.isIOS) {
|
||||||
|
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
|
||||||
|
brandName = iosInfo.systemName!;
|
||||||
|
}
|
||||||
|
|
||||||
|
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||||
|
var version = packageInfo.version;
|
||||||
|
Get.log("updateGetversion:${version}");
|
||||||
|
var entity = await ApiRepository.to.getVersionData(
|
||||||
|
brandName: brandName,
|
||||||
|
currentVersion: version,
|
||||||
|
);
|
||||||
|
if (entity.errorCode! == 0) {
|
||||||
|
if(entity.data!.isUpdate! == 1){
|
||||||
|
showUpdateAlertDialog(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void showUpdateAlertDialog(VersionUndateEntity versionUndateEntity) {
|
||||||
|
showCupertinoDialog(
|
||||||
|
context: Get.context!,
|
||||||
|
builder: (context) {
|
||||||
|
return CupertinoAlertDialog(
|
||||||
|
content: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
// color: AppColors.mainColor,
|
||||||
|
alignment: Alignment.topCenter,
|
||||||
|
height: 50.h,
|
||||||
|
child: Text('版本更新', style: TextStyle(fontSize: 28.sp, color: Colors.blue),)
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left:20.w, right: 20.w, top: 10.h),
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Text(versionUndateEntity.data!.description!, textAlign:TextAlign.start, style: TextStyle(fontSize: 20.sp))
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
actions: versionUndateEntity.data!.isForceUpdate == 0 ?
|
||||||
|
[
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text("下次再说"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
Storage.setString(isShowUpdateVersion, isShowUpdateVersion);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||||
|
onPressed: () async {
|
||||||
|
if (await canLaunch(versionUndateEntity.data!.appDownloadUrl!)) {
|
||||||
|
await launch(versionUndateEntity.data!.appDownloadUrl!);
|
||||||
|
} else {
|
||||||
|
throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]:
|
||||||
|
[
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||||
|
onPressed: () async {
|
||||||
|
if (await canLaunch(versionUndateEntity.data!.appDownloadUrl!)) {
|
||||||
|
await launch(versionUndateEntity.data!.appDownloadUrl!);
|
||||||
|
} else {
|
||||||
|
throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,88 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
|
||||||
|
|
||||||
import '../network/api_repository.dart';
|
|
||||||
import 'versionUndate_state.dart';
|
|
||||||
|
|
||||||
class VersionUndateLogic extends BaseGetXController{
|
|
||||||
VersionUndateState state = VersionUndateState();
|
|
||||||
|
|
||||||
// 获取版本号
|
|
||||||
void getVersionData() async {
|
|
||||||
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
|
||||||
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
|
||||||
// print('androidInfo.manufacturer:${androidInfo.manufacturer}'
|
|
||||||
// 'androidInfo.device:${androidInfo.device}'
|
|
||||||
// 'androidInfo.model:${androidInfo.model}'
|
|
||||||
// 'androidInfo.product:${androidInfo.product}'
|
|
||||||
// 'androidInfo.version.release:${androidInfo.version.release}'
|
|
||||||
// 'androidInfo.version.sdkInt:${androidInfo.version.sdkInt}'
|
|
||||||
// 'androidInfo.version.securityPatch:${androidInfo.version.securityPatch}'
|
|
||||||
// 'androidInfo.version.incremental:${androidInfo.version.incremental}'
|
|
||||||
// 'androidInfo.version.codename:${androidInfo.version.codename}'
|
|
||||||
// 'androidInfo.version.baseOS:${androidInfo.version.baseOS}'
|
|
||||||
// 'androidInfo.board:${androidInfo.board}'
|
|
||||||
// 'androidInfo.bootloader:${androidInfo.bootloader}');
|
|
||||||
|
|
||||||
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
|
||||||
var version = packageInfo.version;
|
|
||||||
|
|
||||||
var entity = await ApiRepository.to.getVersionData(
|
|
||||||
brandName: androidInfo.manufacturer,
|
|
||||||
currentVersion: version,
|
|
||||||
);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
state.versionUndateEntity.value = entity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void showUpdateAlertDialog() {
|
|
||||||
// showCupertinoDialog(
|
|
||||||
// context: Get.context!,
|
|
||||||
// builder: (context) {
|
|
||||||
// return CupertinoAlertDialog(
|
|
||||||
// content: const Text('重置后,该锁的指纹都将被删除哦,确认要重置吗?'),
|
|
||||||
// actions: [
|
|
||||||
// CupertinoDialogAction(
|
|
||||||
// child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.pop(context);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// CupertinoDialogAction(
|
|
||||||
// child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
|
||||||
// onPressed: () {
|
|
||||||
//
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void onReady() {
|
|
||||||
// TODO: implement onReady
|
|
||||||
super.onReady();
|
|
||||||
|
|
||||||
getVersionData();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void onInit() {
|
|
||||||
// TODO: implement onInit
|
|
||||||
super.onInit();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void onClose() {
|
|
||||||
// TODO: implement onClose
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:star_lock/versionUndate/versionUndate_logic.dart';
|
|
||||||
|
|
||||||
class VersionUndatePage extends StatefulWidget {
|
|
||||||
const VersionUndatePage({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<VersionUndatePage> createState() => _VersionUndatePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _VersionUndatePageState extends State<VersionUndatePage> {
|
|
||||||
final logic = Get.put(VersionUndateLogic());
|
|
||||||
final state = Get.find<VersionUndateLogic>().state;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Container(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
// color: AppColors.mainColor,
|
|
||||||
alignment: Alignment.topCenter,
|
|
||||||
height: 50.h,
|
|
||||||
child: Text('版本更新', style: TextStyle(fontSize: 28.sp, color: Colors.blue),)
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.only(left:20.w, right: 20.w, top: 10.h),
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Text('1、修复了一些bug \n2、优化了部分问题 \n3、修补了设置模块bug \n4、优化了部分问题 \n5、修补了设置模块bug', textAlign:TextAlign.start, style: TextStyle(fontSize: 20.sp))
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
|
|
||||||
import 'versionUndate_entity.dart';
|
|
||||||
|
|
||||||
class VersionUndateState{
|
|
||||||
final versionUndateEntity = VersionUndateEntity().obs;
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user