Merge branch 'release' of https://gitee.com/starlock-cn/app-starlock into release

This commit is contained in:
魏少阳 2024-07-17 16:29:34 +08:00
commit 109ff2a253
7 changed files with 113 additions and 160 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

BIN
images/icon_main_sky_1024.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -77,7 +77,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
Container( Container(
padding: EdgeInsets.all(10.w), padding: EdgeInsets.all(10.w),
child: Center( child: Center(
child: Image.asset('images/icon_main_1024.png', child: Image.asset('images/icon_main_sky_1024.png',
width: 110.w, height: 110.w))), width: 110.w, height: 110.w))),
SizedBox(height: 50.w), SizedBox(height: 50.w),
Obx(() => CommonItem( Obx(() => CommonItem(
@ -190,10 +190,11 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
color: AppColors.mainColor, color: AppColors.mainColor,
fontSize: 20.sp)), fontSize: 20.sp)),
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{ Get.toNamed(Routers.webviewShowPage,
'url': XSConstantMacro.userAgreementURL, arguments: <String, String>{
'title': '用户协议'.tr 'url': XSConstantMacro.userAgreementURL,
}); 'title': '用户协议'.tr
});
}, },
)), )),
WidgetSpan( WidgetSpan(
@ -205,10 +206,11 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
color: AppColors.mainColor, color: AppColors.mainColor,
fontSize: 20.sp)), fontSize: 20.sp)),
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{ Get.toNamed(Routers.webviewShowPage,
'url': XSConstantMacro.privacyPolicyURL, arguments: <String, String>{
'title': '隐私政策'.tr 'url': XSConstantMacro.privacyPolicyURL,
}); 'title': '隐私政策'.tr
});
}, },
)), )),
], ],

View File

@ -1,4 +1,3 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart';
@ -32,7 +31,8 @@ class FaceDetailLogic extends BaseGetXController {
_replySubscription = _replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) { EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
// () // ()
if ((reply is SenderAddFaceReply) && (state.ifCurrentScreen.value == true)) { if ((reply is SenderAddFaceReply) &&
(state.ifCurrentScreen.value == true)) {
_replyAddFaceBegin(reply); _replyAddFaceBegin(reply);
} }
}); });
@ -48,18 +48,21 @@ class FaceDetailLogic extends BaseGetXController {
state.sureBtnState.value = 0; state.sureBtnState.value = 0;
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
dismissEasyLoading(); dismissEasyLoading();
if(state.isDeletFace.value == true){ if (state.isDeletFace.value == true) {
deletFaceData(); deletFaceData();
}else{ } else {
editFaceData(); editFaceData();
} }
break; break;
case 0x06: case 0x06:
// //
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey); final List<String>? privateKey =
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList =
changeStringListToIntList(privateKey!);
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey); final List<String>? signKey =
await Storage.getStringList(saveBlueSignKey);
final List<int> signKeyDataList = changeStringListToIntList(signKey!); final List<int> signKeyDataList = changeStringListToIntList(signKey!);
final List<int> token = reply.data.sublist(5, 9); final List<int> token = reply.data.sublist(5, 9);
@ -67,25 +70,25 @@ class FaceDetailLogic extends BaseGetXController {
Storage.setStringList(saveBlueToken, saveStrList); Storage.setStringList(saveBlueToken, saveStrList);
IoSenderManage.senderAddFaceCommand( IoSenderManage.senderAddFaceCommand(
keyID:state.keyId.value.toString(), keyID: state.keyId.value.toString(),
userID:await Storage.getUid(), userID: await Storage.getUid(),
faceNo:int.parse(state.typeNumber.value), faceNo: int.parse(state.typeNumber.value),
useCountLimit:0xffff, useCountLimit: 0xffff,
operate:state.isDeletFace.value ? 2 : 1, // 0: 1 2: 3 operate: state.isDeletFace.value ? 2 : 1, // 0: 1 2: 3
isAdmin:state.isAdministrator.value == true ? 1 : 0, isAdmin: state.isAdministrator.value == true ? 1 : 0,
isForce:state.isStressFace.value == true ? 1 : 0, // isForce: state.isStressFace.value == true ? 1 : 0, //
isRound:state.keyType.value == 4 ? 1: 0, // isRound: state.keyType.value == 4 ? 1 : 0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
startDate: int.parse(state.startDate.value)~/1000, state.weekDay.value), //
endDate: int.parse(state.endDate.value)~/1000, startDate: int.parse(state.startDate.value) ~/ 1000,
startTime:DateTool().dateToHNString(state.startTime.value), endDate: int.parse(state.endDate.value) ~/ 1000,
endTime:DateTool().dateToHNString(state.endTime.value), startTime: DateTool().dateToHNString(state.startTime.value),
needAuthor:1, endTime: DateTool().dateToHNString(state.endTime.value),
signKey:signKeyDataList, needAuthor: 1,
privateKey:getPrivateKeyList, signKey: signKeyDataList,
token: token, privateKey: getPrivateKeyList,
isBeforeAddUser: false token: token,
); isBeforeAddUser: false);
break; break;
default: default:
// //
@ -108,35 +111,38 @@ class FaceDetailLogic extends BaseGetXController {
BlueManage().blueSendData(BlueManage().connectDeviceName, BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState deviceConnectionState) async { (BluetoothConnectionState deviceConnectionState) async {
if (deviceConnectionState == BluetoothConnectionState.connected) { if (deviceConnectionState == BluetoothConnectionState.connected) {
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey); final List<String>? privateKey =
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList =
changeStringListToIntList(privateKey!);
final List<String>? token = await Storage.getStringList(saveBlueToken); final List<String>? token = await Storage.getStringList(saveBlueToken);
final List<int> getTokenList = changeStringListToIntList(token!); final List<int> getTokenList = changeStringListToIntList(token!);
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey); final List<String>? signKey =
await Storage.getStringList(saveBlueSignKey);
final List<int> signKeyDataList = changeStringListToIntList(signKey!); final List<int> signKeyDataList = changeStringListToIntList(signKey!);
IoSenderManage.senderAddFaceCommand( IoSenderManage.senderAddFaceCommand(
keyID:state.keyId.value.toString(), keyID: state.keyId.value.toString(),
userID:await Storage.getUid(), userID: await Storage.getUid(),
faceNo:int.parse(state.typeNumber.value), faceNo: int.parse(state.typeNumber.value),
useCountLimit:0xffff, useCountLimit: 0xffff,
operate:state.isDeletFace.value ? 2 : 1, // 0: 1 2: 3 operate: state.isDeletFace.value ? 2 : 1, // 0: 1 2: 3
isAdmin:state.isAdministrator.value == true ? 1 : 0, isAdmin: state.isAdministrator.value == true ? 1 : 0,
isForce:state.isStressFace.value == true ? 1 : 0, // isForce: state.isStressFace.value == true ? 1 : 0, //
isRound:state.keyType.value == 4 ? 1: 0, // isRound: state.keyType.value == 4 ? 1 : 0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
startDate: int.parse(state.startDate.value)~/1000, state.weekDay.value), //
endDate: int.parse(state.endDate.value)~/1000, startDate: int.parse(state.startDate.value) ~/ 1000,
startTime:DateTool().dateToHNString(state.startTime.value), endDate: int.parse(state.endDate.value) ~/ 1000,
endTime:DateTool().dateToHNString(state.endTime.value), startTime: DateTool().dateToHNString(state.startTime.value),
needAuthor:1, endTime: DateTool().dateToHNString(state.endTime.value),
signKey:signKeyDataList, needAuthor: 1,
privateKey:getPrivateKeyList, signKey: signKeyDataList,
token: getTokenList, privateKey: getPrivateKeyList,
isBeforeAddUser: false token: getTokenList,
); isBeforeAddUser: false);
} else if (deviceConnectionState == } else if (deviceConnectionState ==
BluetoothConnectionState.disconnected) { BluetoothConnectionState.disconnected) {
dismissEasyLoading(); dismissEasyLoading();
@ -170,11 +176,11 @@ class FaceDetailLogic extends BaseGetXController {
faceName: state.changeNameController.text, faceName: state.changeNameController.text,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.faceItemData.value.fingerprintName = state.changeNameController.text; state.faceItemData.value.faceName = state.changeNameController.text;
showToast('修改成功', something: () { showToast('修改成功', something: () {
Get.back(result: 'addScuess'); Get.back(result: 'addScuess');
}); });
}else{ } else {
Get.back(); Get.back();
} }
} }
@ -210,13 +216,14 @@ class FaceDetailLogic extends BaseGetXController {
useDateStr = '永久'.tr; useDateStr = '永久'.tr;
} else if (state.keyType.value == 2) { } else if (state.keyType.value == 2) {
useDateStr = useDateStr =
'${DateTool().dateToYMDHNString(state.startDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}'; '${DateTool().dateToYMDHNString(state.startDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}';
} else if (state.keyType.value == 4) { } else if (state.keyType.value == 4) {
useDateStr = useDateStr =
'${DateTool().dateToYMDString(state.startDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}'; '${DateTool().dateToYMDString(state.startDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}';
} }
return useDateStr; return useDateStr;
} }
@override @override
void onReady() { void onReady() {
super.onReady(); super.onReady();

View File

@ -27,7 +27,8 @@ class LockSetPage extends StatefulWidget {
State<LockSetPage> createState() => _LockSetPageState(); State<LockSetPage> createState() => _LockSetPageState();
} }
class _LockSetPageState extends State<LockSetPage> with RouteAware { class _LockSetPageState extends State<LockSetPage>
with WidgetsBindingObserver, RouteAware {
final LockSetLogic logic = Get.put(LockSetLogic()); final LockSetLogic logic = Get.put(LockSetLogic());
final LockSetState state = Get.find<LockSetLogic>().state; final LockSetState state = Get.find<LockSetLogic>().state;
@ -41,6 +42,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this);
logic.initLoadDataAction(() { logic.initLoadDataAction(() {
setState(() {}); setState(() {});
}); });
@ -646,7 +649,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
} }
Widget rightText(String rightTitle) { Widget rightText(String rightTitle) {
return Text(rightTitle ?? '', return Text(rightTitle,
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor)); style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor));
} }
@ -771,10 +774,19 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!); AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
} }
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.paused) {
//
logic.state.passwordTF.clear();
}
}
@override @override
void dispose() { void dispose() {
/// ///
AppRouteObserver().routeObserver.unsubscribe(this); AppRouteObserver().routeObserver.unsubscribe(this);
WidgetsBinding.instance.removeObserver(this);
super.dispose(); super.dispose();
} }

View File

@ -169,71 +169,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
state.itemData.value.keyboardPwdType != 1 && state.itemData.value.keyboardPwdType != 1 &&
state.itemData.value.keyboardPwdType != 4, state.itemData.value.keyboardPwdType != 4,
child: bottomTip()), child: bottomTip()),
Container(height: 40.h),
SizedBox(
width: ScreenUtil().screenWidth - 40.w,
height: 60.h,
child: OutlinedButton(
style: OutlinedButton.styleFrom(
// backgroundColor: Colors.white,
side: BorderSide(width: 1, color: AppColors.mainColor)),
onPressed: () {
Navigator.pushNamed(context, Routers.cardListPage,
arguments: <String, int?>{
'lockId': state.itemData.value.lockId,
});
},
child: Text(
'设置卡',
style: TextStyle(
color: AppColors.mainColor, fontSize: 24.sp),
)),
),
SizedBox(
height: 10.h,
),
SizedBox(
width: ScreenUtil().screenWidth - 40.w,
height: 60.h,
child: OutlinedButton(
style: OutlinedButton.styleFrom(
// backgroundColor: Colors.white,
side: BorderSide(width: 1, color: AppColors.mainColor)),
onPressed: () {
Navigator.pushNamed(context, Routers.fingerprintListPage,
arguments: <String, int?>{
'lockId': state.itemData.value.lockId,
});
},
child: Text(
'设置指纹',
style: TextStyle(
color: AppColors.mainColor, fontSize: 24.sp),
)),
),
SizedBox(
height: 10.h,
),
SizedBox(
width: ScreenUtil().screenWidth - 40.w,
height: 60.h,
child: OutlinedButton(
style: OutlinedButton.styleFrom(
// backgroundColor: Colors.white,
side: BorderSide(width: 1, color: AppColors.mainColor)),
onPressed: () {
Navigator.pushNamed(
context, Routers.remoteControlListPage,
arguments: <String, int?>{
'lockId': state.itemData.value.lockId,
});
},
child: Text(
'设置遥控',
style: TextStyle(
color: AppColors.mainColor, fontSize: 24.sp),
)),
),
SizedBox( SizedBox(
height: 30.h, height: 30.h,
), ),

View File

@ -1,9 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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:package_info_plus/package_info_plus.dart';
import 'package:star_lock/mine/about/about_console.dart'; import 'package:star_lock/mine/about/about_console.dart';
import '../../app_settings/app_colors.dart'; import '../../app_settings/app_colors.dart';
@ -21,10 +21,10 @@ class AboutPage extends StatefulWidget {
class _AboutPageState extends State<AboutPage> { class _AboutPageState extends State<AboutPage> {
late PackageInfo packageInfo; late PackageInfo packageInfo;
String appName = ""; String appName = '';
String packageName = ""; String packageName = '';
String version = "-----"; String version = '-----';
String buildNumber = "---"; String buildNumber = '---';
@override @override
void initState() { void initState() {
@ -66,13 +66,9 @@ class _AboutPageState extends State<AboutPage> {
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
F.sw( F.sw(skyCall: logoView, xhjCall: () => const SizedBox()),
skyCall: () => logoView(),
xhjCall: () => const SizedBox()),
listView(), listView(),
F.sw( F.sw(skyCall: () => const SizedBox(), xhjCall: logoView),
skyCall: () => const SizedBox(),
xhjCall: () => logoView()),
], ],
), ),
); );
@ -85,13 +81,13 @@ class _AboutPageState extends State<AboutPage> {
children: [ children: [
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.introduce!.tr, leftTitel: TranslationLoader.lanKeys!.introduce!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.introduceURL, 'url': XSConstantMacro.introduceURL,
"title": '介绍'.tr 'title': '介绍'.tr
}); });
}), }),
Divider( Divider(
@ -102,13 +98,13 @@ class _AboutPageState extends State<AboutPage> {
), ),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.userAgreement!.tr, leftTitel: TranslationLoader.lanKeys!.userAgreement!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Get.toNamed(Routers.webviewShowPage, arguments: { Get.toNamed(Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.userAgreementURL, 'url': XSConstantMacro.userAgreementURL,
"title": '用户协议'.tr 'title': '用户协议'.tr
}); });
}), }),
Divider( Divider(
@ -119,13 +115,13 @@ class _AboutPageState extends State<AboutPage> {
), ),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.privacyPolicy!.tr, leftTitel: TranslationLoader.lanKeys!.privacyPolicy!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.privacyPolicyURL, 'url': XSConstantMacro.privacyPolicyURL,
"title": '隐私政策'.tr 'title': '隐私政策'.tr
}); });
}), }),
Divider( Divider(
@ -137,13 +133,13 @@ class _AboutPageState extends State<AboutPage> {
CommonItem( CommonItem(
leftTitel: TranslationLoader leftTitel: TranslationLoader
.lanKeys!.personalInformationCollectionList!.tr, .lanKeys!.personalInformationCollectionList!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.collectionListURL, 'url': XSConstantMacro.collectionListURL,
"title": '个人信息收集清单'.tr 'title': '个人信息收集清单'.tr
}); });
}), }),
Divider( Divider(
@ -155,13 +151,13 @@ class _AboutPageState extends State<AboutPage> {
CommonItem( CommonItem(
leftTitel: leftTitel:
TranslationLoader.lanKeys!.applicationPermissionDescription!.tr, TranslationLoader.lanKeys!.applicationPermissionDescription!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.appPermissionDescURL, 'url': XSConstantMacro.appPermissionDescURL,
"title": '应用权限说明'.tr 'title': '应用权限说明'.tr
}); });
}), }),
Divider( Divider(
@ -173,13 +169,13 @@ class _AboutPageState extends State<AboutPage> {
CommonItem( CommonItem(
leftTitel: leftTitel:
TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr, TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: { Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
"url": XSConstantMacro.thirdPartyInfShareListURL, 'url': XSConstantMacro.thirdPartyInfShareListURL,
"title": '第三方信息共享清单'.tr 'title': '第三方信息共享清单'.tr
}); });
}), }),
], ],
@ -221,14 +217,14 @@ class _AboutPageState extends State<AboutPage> {
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: Image.asset( child: Image.asset(
F.sw( F.sw(
skyCall: () => "images/icon_main_1024.png", skyCall: () => 'images/icon_main_sky_1024.png',
xhjCall: () => "images/icon_main_xhj_1024.png"), xhjCall: () => 'images/icon_main_xhj_1024.png'),
width: 160.w, width: 160.w,
height: 160.w), height: 160.w),
), ),
SizedBox(height: 20.h), SizedBox(height: 20.h),
Text( Text(
"${F.title} $version+$buildNumber", '${F.title} $version+$buildNumber',
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor), style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
), ),
SizedBox(height: 20.h), SizedBox(height: 20.h),