1、修复锁分组模块问题

2、修复电子钥匙、授权管理员、密码、卡、指纹、人脸名字过长不显示问题
3、修复App开锁时需手机连网的锁问题
This commit is contained in:
魏少阳 2024-06-13 09:12:39 +08:00
parent 3e04c0de5f
commit 179af115cb
16 changed files with 330 additions and 111 deletions

View File

@ -233,7 +233,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: Text(receiveUser, child: Text(receiveUser,
maxLines: 3, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,

View File

@ -46,12 +46,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
rightTitle: state.typeNumber.value, rightTitle: state.typeNumber.value,
isHaveDirection: false, isHaveDirection: false,
isHaveLine: true)), isHaveLine: true)),
Obx(() => CommonItem( Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr,state.typeName.value, () {
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: state.typeName.value,
isHaveDirection: true,
isHaveLine: true,
action: () {
ShowTipView().showTFViewAlertDialog( ShowTipView().showTFViewAlertDialog(
state.changeNameController, state.changeNameController,
'${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}', '${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}',
@ -212,6 +207,40 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
); );
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){
return GestureDetector(
onTap: action,
child: Container(
// height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
child: Row(
children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w),
Expanded(
child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, ))
),
SizedBox(width: 10.w),
Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
)
],
),
),
);
}
//isStressFingerprint false: ture: //isStressFingerprint false: ture:
CupertinoSwitch _isStressFingerprint() { CupertinoSwitch _isStressFingerprint() {
return CupertinoSwitch( return CupertinoSwitch(

View File

@ -1,3 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart'; import 'package:star_lock/appRouters.dart';

View File

@ -56,12 +56,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: ListView( body: ListView(
children: <Widget>[ children: <Widget>[
Obx(() => CommonItem( Obx(() => lockDataListItem('姓名'.tr, state.keyName.value, () {
leftTitel: '姓名'.tr,
rightTitle: state.keyName.value,
isHaveDirection: true,
isHaveLine: true,
action: () {
showCupertinoAlertDialog( showCupertinoAlertDialog(
tipsTitle: '修改姓名'.tr, alertEnum: ShowAlertEnum.name); tipsTitle: '修改姓名'.tr, alertEnum: ShowAlertEnum.name);
})), })),
@ -282,6 +277,40 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
); );
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){
return GestureDetector(
onTap: action,
child: Container(
// height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
child: Row(
children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w),
Expanded(
child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, ))
),
SizedBox(width: 10.w),
Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
)
],
),
),
);
}
CupertinoSwitch _realNameAuthSwitch() { CupertinoSwitch _realNameAuthSwitch() {
return CupertinoSwitch( return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue, activeColor: CupertinoColors.activeBlue,

View File

@ -283,7 +283,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: Text(receiveUser, child: Text(receiveUser,
maxLines: 3, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,

View File

@ -44,12 +44,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
rightTitle: state.typeNumber.value, rightTitle: state.typeNumber.value,
isHaveDirection: false, isHaveDirection: false,
isHaveLine: true)), isHaveLine: true)),
Obx(() => CommonItem( Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, state.typeName.value, () {
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: state.typeName.value,
isHaveDirection: true,
isHaveLine: true,
action: () {
// showCupertinoAlertDialog(context); // showCupertinoAlertDialog(context);
ShowTipView().showTFViewAlertDialog( ShowTipView().showTFViewAlertDialog(
state.changeNameController, state.changeNameController,
@ -220,6 +215,40 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
); );
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){
return GestureDetector(
onTap: action,
child: Container(
// height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
child: Row(
children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w),
Expanded(
child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, ))
),
SizedBox(width: 10.w),
Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
)
],
),
),
);
}
CupertinoSwitch _isStressFace() { CupertinoSwitch _isStressFace() {
return CupertinoSwitch( return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue, activeColor: CupertinoColors.activeBlue,

View File

@ -46,12 +46,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
rightTitle: state.typeNumber.value, rightTitle: state.typeNumber.value,
isHaveDirection: false, isHaveDirection: false,
isHaveLine: true)), isHaveLine: true)),
Obx(() => CommonItem( Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, state.typeName.value, () {
leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: state.typeName.value,
isHaveDirection: true,
isHaveLine: true,
action: () {
ShowTipView().showTFViewAlertDialog( ShowTipView().showTFViewAlertDialog(
state.changeNameController, state.changeNameController,
'${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}', '${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}',
@ -227,6 +222,40 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
); );
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){
return GestureDetector(
onTap: action,
child: Container(
// height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
child: Row(
children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w),
Expanded(
child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, ))
),
SizedBox(width: 10.w),
Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
)
],
),
),
);
}
//isStressFingerprint false: ture: //isStressFingerprint false: ture:
CupertinoSwitch _isStressFingerprint() { CupertinoSwitch _isStressFingerprint() {
return CupertinoSwitch( return CupertinoSwitch(

View File

@ -104,12 +104,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
SizedBox(height: 10.h), SizedBox(height: 10.h),
Obx(() => Visibility( Obx(() => Visibility(
visible: state.lockBasicInfo.value.isLockOwner == 1 || state.lockBasicInfo.value.keyRight == 1, visible: state.lockBasicInfo.value.isLockOwner == 1 || state.lockBasicInfo.value.keyRight == 1,
child: CommonItem( child: lockDataListItem(TranslationLoader.lanKeys!.lockName!.tr, state.lockBasicInfo.value.lockAlias ?? '', () async {
leftTitel: TranslationLoader.lanKeys!.lockName!.tr,
rightTitle: state.lockBasicInfo.value.lockAlias,
isHaveLine: true,
isHaveDirection: true,
action: () async {
var data = await Get.toNamed(Routers.editLockNamePage, arguments: <String, LockSetInfoData>{ var data = await Get.toNamed(Routers.editLockNamePage, arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
}); });
@ -119,12 +114,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
}); });
} }
}))), }))),
Obx(() => CommonItem( Obx(() => lockDataListItem(TranslationLoader.lanKeys!.lockGrouping!.tr, state.lockBasicInfo.value.groupName ?? '', () async {
leftTitel: TranslationLoader.lanKeys!.lockGrouping!.tr,
rightTitle: state.lockBasicInfo.value.groupName ?? '',
isHaveLine: true,
isHaveDirection: true,
action: () async {
Get.toNamed(Routers.lockSelectGroupingPage, arguments: <String, LockSetInfoData>{ Get.toNamed(Routers.lockSelectGroupingPage, arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
})!.then((val) { })!.then((val) {
@ -187,4 +177,39 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
], ],
)); ));
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){
return GestureDetector(
onTap: action,
child: Container(
// height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
child: Row(
children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w),
Expanded(
child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, ))
),
SizedBox(width: 10.w),
Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
)
],
),
),
);
}
} }

View File

@ -12,9 +12,9 @@ class LockSelectGroupingLogic extends BaseGetXController {
// //
Future<void> addLockGroupRequest() async { Future<void> addLockGroupRequest() async {
MassSendLockGroupListEntity entity = await ApiRepository.to.addLockGroup(state.changeNameController.text, '0'); final MassSendLockGroupListEntity entity = await ApiRepository.to.addLockGroup(state.changeNameController.text, '0');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("创建成功".tr, something: () { showToast('创建成功'.tr, something: () {
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
} }
@ -22,15 +22,16 @@ class LockSelectGroupingLogic extends BaseGetXController {
// //
Future<void> setLockGroupRequest(GroupListItem itemData) async { Future<void> setLockGroupRequest(GroupListItem itemData) async {
MassSendLockGroupListEntity entity = await ApiRepository.to.setLockGroup( final MassSendLockGroupListEntity entity = await ApiRepository.to.setLockGroup(
state.lockSetInfoData.value.lockId.toString(), itemData.keyGroupId.toString()); state.lockSetInfoData.value.lockId.toString(), itemData.keyGroupId.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("设置锁分组成功".tr, something: () { state.lockBasicInfo.value.groupId = itemData.keyGroupId;
state.lockBasicInfo.value.groupId = itemData.keyGroupId; state.lockBasicInfo.value.groupName = itemData.keyGroupName;
state.lockBasicInfo.value.groupName = itemData.keyGroupName;
mockNetworkDataRequest(); state.lockSetInfoData.value.lockBasicInfo!.groupId = itemData.keyGroupId;
state.lockSetInfoData.value.lockBasicInfo!.groupId = itemData.keyGroupId; state.lockSetInfoData.value.lockBasicInfo!.groupName = itemData.keyGroupName;
state.lockSetInfoData.value.lockBasicInfo!.groupName = itemData.keyGroupName;
showToast('设置锁分组成功'.tr, something: () {
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
}); });
@ -38,8 +39,8 @@ class LockSelectGroupingLogic extends BaseGetXController {
} }
// //
void mockNetworkDataRequest() async { Future<void> mockNetworkDataRequest() async {
MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('1'); final MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('1');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.groupList.value = entity.data!.groupList!; state.groupList.value = entity.data!.groupList!;
} }
@ -47,20 +48,17 @@ class LockSelectGroupingLogic extends BaseGetXController {
@override @override
void onReady() { void onReady() {
// TODO: implement onReady
super.onReady(); super.onReady();
mockNetworkDataRequest(); mockNetworkDataRequest();
} }
@override @override
void onInit() { void onInit() {
// TODO: implement onInit
super.onInit(); super.onInit();
} }
@override @override
void onClose() { void onClose() {
// TODO: implement onClose super.onClose();
} }
} }

View File

@ -1,8 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.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:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/lockSelectGrouping/lockSelectGrouping_state.dart';
import '../../../../../app_settings/app_colors.dart'; import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/commonItem.dart'; import '../../../../../tools/commonItem.dart';
@ -21,8 +23,8 @@ class LockSelectGroupingPage extends StatefulWidget {
} }
class _LockSelectGroupingPageState extends State<LockSelectGroupingPage> { class _LockSelectGroupingPageState extends State<LockSelectGroupingPage> {
final logic = Get.put(LockSelectGroupingLogic()); final LockSelectGroupingLogic logic = Get.put(LockSelectGroupingLogic());
final state = Get.find<LockSelectGroupingLogic>().state; final LockSelectGroupingState state = Get.find<LockSelectGroupingLogic>().state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,7 +36,7 @@ class _LockSelectGroupingPageState extends State<LockSelectGroupingPage> {
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
children: [ children: <Widget>[
Expanded(child: _buildMainUI()), Expanded(child: _buildMainUI()),
SubmitBtn( SubmitBtn(
btnName: TranslationLoader.lanKeys!.createNewGroup!.tr, btnName: TranslationLoader.lanKeys!.createNewGroup!.tr,
@ -44,10 +46,12 @@ class _LockSelectGroupingPageState extends State<LockSelectGroupingPage> {
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () { onClick: () {
// showCupertinoAlertDialog(context); // showCupertinoAlertDialog(context);
ShowTipView().showTFViewAlertDialog(state.changeNameController, TranslationLoader.lanKeys!.createNewGroup!.tr, "请输入分组名称".tr, (){ ShowTipView().showTFViewAlertDialog(state.changeNameController, TranslationLoader.lanKeys!.createNewGroup!.tr, '请输入分组名称'.tr, (){
logic.addLockGroupRequest(); logic.addLockGroupRequest();
Get.back(); Get.back();
}); }, isShowSuffixIcon:true, inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(50),
]);
}), }),
SizedBox( SizedBox(
height: 40.h, height: 40.h,
@ -60,27 +64,45 @@ class _LockSelectGroupingPageState extends State<LockSelectGroupingPage> {
Widget _buildMainUI() { Widget _buildMainUI() {
return Obx(() => state.groupList.value.isNotEmpty ? ListView.builder( return Obx(() => state.groupList.value.isNotEmpty ? ListView.builder(
itemCount: state.groupList.value.length, itemCount: state.groupList.value.length,
itemBuilder: (c, index) { itemBuilder: (BuildContext c, int index) {
GroupListItem itemData = state.groupList.value[index]; final GroupListItem itemData = state.groupList.value[index];
return CommonItem( return lockDataListItem(itemData.keyGroupName ?? '', state.lockBasicInfo.value.groupId == itemData.keyGroupId,
leftTitel: itemData.keyGroupName, () {
rightTitle: "", logic.setLockGroupRequest(itemData).then((value) => setState(() {}));
allHeight: 70.h,
isHaveLine: true,
isHaveDirection: false,
isHaveRightWidget: true,
rightWidget: state.lockBasicInfo.value.groupId == itemData.keyGroupId
? Image(
image: const AssetImage("images/icon_item_checked.png"),
width: 30.w,
height: 30.w,
fit: BoxFit.contain,
)
: Container(),
action: () {
logic.setLockGroupRequest(itemData);
}); });
}) : NoData()); }) : NoData());
} }
Widget lockDataListItem(String title, bool isShowSeletIcon, Function()? action){
return GestureDetector(
onTap: action,
child: Container(
// height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
child: Row(
children: <Widget>[
Expanded(
child: Text(title, style: TextStyle(fontSize: 22.sp))
),
SizedBox(width: 15.w),
if (isShowSeletIcon) Image(
image: const AssetImage('images/icon_item_checked.png'),
width: 30.w,
height: 30.w,
fit: BoxFit.contain,
) else SizedBox(width: 30.w, height: 30.w,),
],
),
),
);
}
} }

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -7,19 +6,19 @@ import '../../../electronicKey/massSendElectronicKey/massSendLockGroupList/massS
import '../../lockSet/lockSetInfo_entity.dart'; import '../../lockSet/lockSetInfo_entity.dart';
class LockSelectGroupingState { class LockSelectGroupingState {
var lockSetInfoData = LockSetInfoData().obs;
var lockBasicInfo = LockBasicInfo().obs;
var groupList = <GroupListItem>[].obs;
final TextEditingController changeNameController = TextEditingController();
LockSelectGroupingState() { LockSelectGroupingState() {
var map = Get.arguments; var map = Get.arguments;
if(map["lockSetInfoData"] != null){ if(map['lockSetInfoData'] != null){
lockSetInfoData.value = map["lockSetInfoData"]; lockSetInfoData.value = map['lockSetInfoData'];
if(lockSetInfoData.value.lockBasicInfo!=null){ if(lockSetInfoData.value.lockBasicInfo!=null){
lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!; lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!;
} }
} }
} }
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
Rx<LockBasicInfo> lockBasicInfo = LockBasicInfo().obs;
RxList<GroupListItem> groupList = <GroupListItem>[].obs;
final TextEditingController changeNameController = TextEditingController();
} }

View File

@ -473,10 +473,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
// //
Obx( Obx(
() => Visibility( () => Visibility(
visible: (state.lockBasicInfo.value.isLockOwner == 1 && visible: state.lockBasicInfo.value.isLockOwner == 1 && state.lockFeature.value.attendance == 1,
state.lockFeature.value.attendance == 1)
? true
: false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
rightTitle: '', rightTitle: '',

View File

@ -72,15 +72,18 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
context, state.inputPwdController); context, state.inputPwdController);
} }
})), })),
Obx(() => CommonItem( // Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.name!.tr, // leftTitel: TranslationLoader.lanKeys!.name!.tr,
rightTitle: state.keyboardPwdName.value, // rightTitle: state.keyboardPwdName.value,
isHaveDirection: true, // isHaveDirection: true,
isHaveLine: true, // isHaveLine: true,
action: () { // action: () {
showCupertinoAlertDialog( // showCupertinoAlertDialog(
context, state.inputNameController); // context, state.inputNameController);
})), // })),
Obx(() => lockDataListItem(TranslationLoader.lanKeys!.name!.tr, state.keyboardPwdName.value, (){
showCupertinoAlertDialog(context, state.inputNameController);
})),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '有效期', leftTitel: '有效期',
rightTitle: logic.getUseDateStr(), rightTitle: logic.getUseDateStr(),
@ -277,6 +280,40 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
); );
} }
Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){
return GestureDetector(
onTap: action,
child: Container(
// height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
child: Row(
children: <Widget>[
Text(leftTitle, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 10.w),
Expanded(
child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, ))
),
SizedBox(width: 10.w),
Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
)
],
),
),
);
}
// //
String getSenderDate(PasswordKeyListItem indexEntity) { String getSenderDate(PasswordKeyListItem indexEntity) {
String senderDate = ''; String senderDate = '';

View File

@ -131,11 +131,11 @@ class _APPUnlockNeedMobileNetworkingLockPageState extends State<APPUnlockNeedMob
SubmitBtn( SubmitBtn(
btnName: TranslationLoader.lanKeys!.sure!.tr, btnName: TranslationLoader.lanKeys!.sure!.tr,
onClick: () { onClick: () {
if (state.selectLockIdList.isNotEmpty) { // if (state.selectLockIdList.isNotEmpty) {
logic.setAppUnlockMustOnlineRequest(); logic.setAppUnlockMustOnlineRequest();
} else { // } else {
logic.showToast('请选择需设置的锁'); // logic.showToast('请选择需设置的锁');
} // }
}), }),
SizedBox( SizedBox(
height: 40.h, height: 40.h,

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.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:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
@ -55,7 +56,9 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
logic.showToast( logic.showToast(
TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr); TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
} }
}); }, isShowSuffixIcon:true, inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(50),
]);
}, },
), ),
], ],
@ -115,11 +118,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(1)), borderRadius: BorderRadius.all(Radius.circular(1)),
), ),
child: CommonItem( child: lockDataListItem('${itemData.keyGroupName}(${itemData.lockList?.length})', () {
leftTitel: '${itemData.keyGroupName}(${itemData.lockList?.length})',
rightTitle: '',
allHeight: 70.h,
action: () {
Get.toNamed(Routers.lockItemListPage, arguments: <String, GroupListItem>{ Get.toNamed(Routers.lockItemListPage, arguments: <String, GroupListItem>{
'groupListItem': itemData, 'groupListItem': itemData,
'ungrouped': state.ungrouped 'ungrouped': state.ungrouped
@ -200,4 +199,31 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
), ),
); );
} }
Widget lockDataListItem(String title, Function()? action){
return GestureDetector(
onTap: action,
child: Container(
// height: 70.h,
padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
),
child: Row(
children: <Widget>[
Expanded(child:
Text(title, style: TextStyle(fontSize: 22.sp))
),
// Text(title, style: TextStyle(fontSize: 22.sp)),
],
),
),
);
}
} }

View File

@ -93,9 +93,7 @@ class ShowTipView {
); );
} }
void showTFViewAlertDialog(TextEditingController controller, String title, void showTFViewAlertDialog(TextEditingController controller, String title, String tipTitle, Function sureClick, {List<TextInputFormatter>? inputFormatters, bool? isShowSuffixIcon}) {
String tipTitle, Function sureClick,
{List<TextInputFormatter>? inputFormatters, bool? isShowSuffixIcon}) {
// //
showDialog( showDialog(
context: Get.context!, context: Get.context!,