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(
padding: EdgeInsets.all(10.w),
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))),
SizedBox(height: 50.w),
Obx(() => CommonItem(
@ -190,10 +190,11 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
color: AppColors.mainColor,
fontSize: 20.sp)),
onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
'url': XSConstantMacro.userAgreementURL,
'title': '用户协议'.tr
});
Get.toNamed(Routers.webviewShowPage,
arguments: <String, String>{
'url': XSConstantMacro.userAgreementURL,
'title': '用户协议'.tr
});
},
)),
WidgetSpan(
@ -205,10 +206,11 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
color: AppColors.mainColor,
fontSize: 20.sp)),
onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
'url': XSConstantMacro.privacyPolicyURL,
'title': '隐私政策'.tr
});
Get.toNamed(Routers.webviewShowPage,
arguments: <String, String>{
'url': XSConstantMacro.privacyPolicyURL,
'title': '隐私政策'.tr
});
},
)),
],

View File

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

View File

@ -27,7 +27,8 @@ class LockSetPage extends StatefulWidget {
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 LockSetState state = Get.find<LockSetLogic>().state;
@ -41,6 +42,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
logic.initLoadDataAction(() {
setState(() {});
});
@ -646,7 +649,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
}
Widget rightText(String rightTitle) {
return Text(rightTitle ?? '',
return Text(rightTitle,
textAlign: TextAlign.end,
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)!);
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.paused) {
//
logic.state.passwordTF.clear();
}
}
@override
void dispose() {
///
AppRouteObserver().routeObserver.unsubscribe(this);
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}

View File

@ -169,71 +169,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
state.itemData.value.keyboardPwdType != 1 &&
state.itemData.value.keyboardPwdType != 4,
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(
height: 30.h,
),

View File

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