1,操作记录页面修改
2,发送电子钥匙页面修改 3,部分bug修改
This commit is contained in:
parent
027f81fb61
commit
82f4fe293c
@ -2,6 +2,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
||||||
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart';
|
||||||
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
||||||
@ -59,7 +60,6 @@ import 'main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdayS
|
|||||||
import 'main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart';
|
import 'main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart';
|
||||||
import 'main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart';
|
import 'main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart';
|
||||||
import 'main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_page.dart';
|
import 'main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_page.dart';
|
||||||
import 'main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord_page.dart';
|
|
||||||
import 'main/lockDetail/face/addFace/addFace_page.dart';
|
import 'main/lockDetail/face/addFace/addFace_page.dart';
|
||||||
import 'main/lockDetail/face/addFaceType/addFaceTypeManage/addFaceTypeManage_page.dart';
|
import 'main/lockDetail/face/addFaceType/addFaceTypeManage/addFaceTypeManage_page.dart';
|
||||||
import 'main/lockDetail/face/faceList/faceList_page.dart';
|
import 'main/lockDetail/face/faceList/faceList_page.dart';
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|||||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_state.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_state.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
import 'package:star_lock/main/lockDetail/lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
|
|
||||||
@ -18,7 +19,6 @@ import '../../../blue/sender_manage.dart';
|
|||||||
import '../../../network/api_repository.dart';
|
import '../../../network/api_repository.dart';
|
||||||
import '../../../tools/baseGetXController.dart';
|
import '../../../tools/baseGetXController.dart';
|
||||||
import '../../../tools/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
import '../electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
|
||||||
|
|
||||||
class DoorLockLogLogic extends BaseGetXController {
|
class DoorLockLogLogic extends BaseGetXController {
|
||||||
DoorLockLogState state = DoorLockLogState();
|
DoorLockLogState state = DoorLockLogState();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_state.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_state.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
@ -23,7 +23,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
|||||||
state.itemData.value.keyName = state.changeNameController.text;
|
state.itemData.value.keyName = state.changeNameController.text;
|
||||||
state.keyName.value = state.itemData.value.keyName!;
|
state.keyName.value = state.itemData.value.keyName!;
|
||||||
Get.back();
|
Get.back();
|
||||||
showToast("修改成功", something: (){
|
showToast("修改成功", something: () {
|
||||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
|||||||
.deleteElectronicKey(state.itemData.value.keyId.toString());
|
.deleteElectronicKey(state.itemData.value.keyId.toString());
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("删除电子钥匙成功");
|
print("删除电子钥匙成功");
|
||||||
showToast("删除成功", something: (){
|
showToast("删除成功", something: () {
|
||||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_state.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_state.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
@ -25,7 +25,7 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
|||||||
hoursEnd: state.hoursEnd.value,
|
hoursEnd: state.hoursEnd.value,
|
||||||
isCoerced: state.isCoerced.value);
|
isCoerced: state.isCoerced.value);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast("修改成功", something: (){
|
showToast("修改成功", something: () {
|
||||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
@ -44,7 +44,7 @@ class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
|||||||
state.startDay.value,
|
state.startDay.value,
|
||||||
state.weekDays.value);
|
state.weekDays.value);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast("修改成功", something: (){
|
showToast("修改成功", something: () {
|
||||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -0,0 +1,31 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_state.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class KeyOperationRecordLogic extends BaseGetXController {
|
||||||
|
final KeyOperationRecordState state = KeyOperationRecordState();
|
||||||
|
|
||||||
|
//请求操作记录列表
|
||||||
|
Future<void> mockNetworkDataRequest() async {
|
||||||
|
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordList(
|
||||||
|
'0',
|
||||||
|
state.keyId.value,
|
||||||
|
'0',
|
||||||
|
state.lockId.value,
|
||||||
|
'1',
|
||||||
|
'1',
|
||||||
|
'20',
|
||||||
|
'0',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
state.keyboardPwdId.value,
|
||||||
|
state.cardId.value,
|
||||||
|
state.fingerprintId.value);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
print("操作记录列表成功:${entity.data?.itemList}");
|
||||||
|
state.dataList.value = entity.data!.itemList!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,13 +1,12 @@
|
|||||||
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:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_logic.dart';
|
||||||
|
import 'package:star_lock/tools/noData.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import 'package:star_lock/tools/titleAppBar.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import 'package:star_lock/translations/trans_lib.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
|
||||||
|
|
||||||
class KeyOperationRecordPage extends StatefulWidget {
|
class KeyOperationRecordPage extends StatefulWidget {
|
||||||
const KeyOperationRecordPage({Key? key}) : super(key: key);
|
const KeyOperationRecordPage({Key? key}) : super(key: key);
|
||||||
@ -17,31 +16,11 @@ class KeyOperationRecordPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
|
class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
|
||||||
String _keyId = '';
|
final logic = Get.put(KeyOperationRecordLogic());
|
||||||
String _lockId = '';
|
final state = Get.find<KeyOperationRecordLogic>().state;
|
||||||
String _keyboardPwdId = ''; //密码ID
|
|
||||||
String _cardId = ''; //卡ID
|
|
||||||
String _fingerprintId = ''; //指纹ID
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
|
||||||
if (obj != null && (obj["keyId"] != null)) {
|
|
||||||
_keyId = obj["keyId"];
|
|
||||||
}
|
|
||||||
if (obj != null && (obj["lockId"] != null)) {
|
|
||||||
_lockId = obj["lockId"];
|
|
||||||
}
|
|
||||||
if (obj != null && (obj["keyboardPwdId"] != null)) {
|
|
||||||
_keyboardPwdId = obj["keyboardPwdId"];
|
|
||||||
}
|
|
||||||
if (obj != null && (obj["cardId"] != null)) {
|
|
||||||
_cardId = obj["cardId"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj != null && (obj["fingerprintId"] != null)) {
|
|
||||||
_fingerprintId = obj["fingerprintId"];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
@ -49,8 +28,12 @@ class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
|
|||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
),
|
),
|
||||||
body: FutureBuilder<List<KeyRecordDataItem>>(
|
body: Obx(() => state.dataList.value.isEmpty
|
||||||
future: mockNetworkDataRequest(),
|
? NoData()
|
||||||
|
: _buildMainUI(state.dataList.value)),
|
||||||
|
/*
|
||||||
|
FutureBuilder<List<KeyRecordDataItem>>(
|
||||||
|
future: logic.mockNetworkDataRequest(),
|
||||||
builder: (BuildContext context,
|
builder: (BuildContext context,
|
||||||
AsyncSnapshot<List<KeyRecordDataItem>> snapshot) {
|
AsyncSnapshot<List<KeyRecordDataItem>> snapshot) {
|
||||||
//请求结束
|
//请求结束
|
||||||
@ -70,41 +53,19 @@ class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//请求未结束 显示loading
|
//请求未结束 显示loading
|
||||||
return Container();
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
'暂无数据',
|
||||||
|
style:
|
||||||
|
TextStyle(color: AppColors.blackColor, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
*/
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//请求操作记录列表
|
|
||||||
Future<List<KeyRecordDataItem>> mockNetworkDataRequest() async {
|
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordList(
|
|
||||||
'0',
|
|
||||||
_keyId,
|
|
||||||
'0',
|
|
||||||
_lockId,
|
|
||||||
'1',
|
|
||||||
'1',
|
|
||||||
'20',
|
|
||||||
'0',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
_keyboardPwdId,
|
|
||||||
_cardId,
|
|
||||||
_fingerprintId);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
print("操作记录列表成功:${entity.data?.itemList}");
|
|
||||||
}
|
|
||||||
final data = entity.data;
|
|
||||||
if (data != null) {
|
|
||||||
return data.itemList!;
|
|
||||||
} else {
|
|
||||||
List<KeyRecordDataItem> dataList = [];
|
|
||||||
return dataList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildMainUI(List<KeyRecordDataItem> itemDataList) {
|
Widget _buildMainUI(List<KeyRecordDataItem> itemDataList) {
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
itemCount: itemDataList.length,
|
itemCount: itemDataList.length,
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
|
class KeyOperationRecordState {
|
||||||
|
var dataList = <KeyRecordDataItem>[].obs;
|
||||||
|
final keyId = ''.obs;
|
||||||
|
final lockId = ''.obs;
|
||||||
|
final keyboardPwdId = ''.obs; //密码ID
|
||||||
|
final cardId = ''.obs; //卡ID
|
||||||
|
final fingerprintId = ''.obs; //指纹ID
|
||||||
|
|
||||||
|
KeyOperationRecordState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
// dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
|
if ((map["keyId"] != null)) {
|
||||||
|
keyId.value = map["keyId"];
|
||||||
|
}
|
||||||
|
if ((map["lockId"] != null)) {
|
||||||
|
lockId.value = map["lockId"];
|
||||||
|
}
|
||||||
|
if ((map["keyboardPwdId"] != null)) {
|
||||||
|
keyboardPwdId.value = map["keyboardPwdId"];
|
||||||
|
}
|
||||||
|
if ((map["cardId"] != null)) {
|
||||||
|
cardId.value = map["cardId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((map["fingerprintId"] != null)) {
|
||||||
|
fingerprintId.value = map["fingerprintId"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -40,7 +40,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
// 获取是否是演示模式 演示模式不获取接口
|
// 获取是否是演示模式 演示模式不获取接口
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
logic.mockNetworkDataRequest().then((ElectronicKeyListEntity value){
|
logic.mockNetworkDataRequest().then((ElectronicKeyListEntity value) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -73,11 +73,11 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: EasyRefreshTool(
|
body: EasyRefreshTool(
|
||||||
onRefresh: (){
|
onRefresh: () {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
mockRequest();
|
mockRequest();
|
||||||
},
|
},
|
||||||
onLoad: (){
|
onLoad: () {
|
||||||
mockRequest();
|
mockRequest();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -92,8 +92,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(child: _buildMainUI()),
|
||||||
child: _buildMainUI()),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
@ -123,65 +122,78 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
|
|
||||||
Widget _buildMainUI() {
|
Widget _buildMainUI() {
|
||||||
return Obx(() => state.itemDataList.value.isEmpty
|
return Obx(() => state.itemDataList.value.isEmpty
|
||||||
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h)
|
? NoData(
|
||||||
|
noDataHeight: 1.sh -
|
||||||
|
ScreenUtil().statusBarHeight -
|
||||||
|
ScreenUtil().bottomBarHeight -
|
||||||
|
190.h -
|
||||||
|
64.h)
|
||||||
: SlidableAutoCloseBehavior(
|
: SlidableAutoCloseBehavior(
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: state.itemDataList.value.length,
|
itemCount: state.itemDataList.value.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (c, index) {
|
||||||
ElectronicKeyListItem indexEntity = state.itemDataList.value[index];
|
ElectronicKeyListItem indexEntity =
|
||||||
String useDateStr = ''; //使用期限
|
state.itemDataList.value[index];
|
||||||
String keyStatus = ''; //钥匙状态
|
String useDateStr = ''; //使用期限
|
||||||
|
String keyStatus = ''; //钥匙状态
|
||||||
|
|
||||||
//使用期限
|
//使用期限
|
||||||
useDateStr = getUseDateStr(indexEntity);
|
useDateStr = getUseDateStr(indexEntity);
|
||||||
|
|
||||||
//钥匙状态
|
//钥匙状态
|
||||||
keyStatus = getKeyStatus(indexEntity.keyStatus);
|
keyStatus = getKeyStatus(indexEntity.keyStatus);
|
||||||
|
|
||||||
//是否为管理钥匙
|
//是否为管理钥匙
|
||||||
bool isAdminKey = false;
|
bool isAdminKey = false;
|
||||||
if (indexEntity.keyRight == 1) {
|
if (indexEntity.keyRight == 1) {
|
||||||
isAdminKey = true;
|
isAdminKey = true;
|
||||||
} else {
|
} else {
|
||||||
isAdminKey = false;
|
isAdminKey = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Slidable(
|
return Slidable(
|
||||||
key:ValueKey(indexEntity.keyId),
|
key: ValueKey(indexEntity.keyId),
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
extentRatio: 0.2,
|
extentRatio: 0.2,
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
children: [
|
children: [
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
onPressed: (BuildContext context){
|
onPressed: (BuildContext context) {
|
||||||
showIosTipViewDialog(context, indexEntity.keyId!.toString());
|
showIosTipViewDialog(
|
||||||
},
|
context, indexEntity.keyId!.toString());
|
||||||
backgroundColor: Colors.red,
|
},
|
||||||
foregroundColor: Colors.white,
|
backgroundColor: Colors.red,
|
||||||
label: '删除',
|
foregroundColor: Colors.white,
|
||||||
),
|
label: '删除',
|
||||||
],
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: _electronicKeyItem(
|
||||||
|
'images/controls_user.png',
|
||||||
|
indexEntity.keyName!,
|
||||||
|
useDateStr,
|
||||||
|
keyStatus,
|
||||||
|
isAdminKey, () {
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, Routers.electronicKeyDetailPage,
|
||||||
|
arguments: {"itemData": indexEntity}).then((val) {
|
||||||
|
if (val != null) {
|
||||||
|
logic.mockNetworkDataRequest();
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
child: _electronicKeyItem('images/controls_user.png', indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
));
|
||||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
|
||||||
arguments: {"itemData": indexEntity}).then((val) {
|
|
||||||
if (val != null) {
|
|
||||||
logic.mockNetworkDataRequest();
|
|
||||||
setState(() {});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
|
||||||
return const Divider(
|
|
||||||
height: 1,
|
|
||||||
color: AppColors.greyLineColor,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDeleteBtn(String keyId) {
|
Widget _buildDeleteBtn(String keyId) {
|
||||||
@ -291,7 +303,11 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 30.w),
|
SizedBox(width: 30.w),
|
||||||
Image.asset(avatarURL, width: 60.w, height: 60.w,),
|
Image.asset(
|
||||||
|
avatarURL,
|
||||||
|
width: 60.w,
|
||||||
|
height: 60.w,
|
||||||
|
),
|
||||||
SizedBox(width: 20.w),
|
SizedBox(width: 20.w),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -305,16 +321,20 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(receiveUser,
|
||||||
receiveUser,
|
maxLines: 1,
|
||||||
maxLines: 1,
|
overflow: TextOverflow.ellipsis,
|
||||||
overflow: TextOverflow.ellipsis,
|
style: TextStyle(
|
||||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
fontSize: 24.sp,
|
||||||
),
|
color: AppColors.blackColor)),
|
||||||
),
|
),
|
||||||
SizedBox(width: 10.w),
|
SizedBox(width: 10.w),
|
||||||
isAdminKey
|
isAdminKey
|
||||||
? Image.asset('images/icon_electronicKey_admin.png', width: 24.w, height: 20.w,)
|
? Image.asset(
|
||||||
|
'images/icon_electronicKey_admin.png',
|
||||||
|
width: 24.w,
|
||||||
|
height: 20.w,
|
||||||
|
)
|
||||||
: Container(),
|
: Container(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -53,7 +53,8 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget indexChangeWidget() {
|
Widget indexChangeWidget() {
|
||||||
if (state.isSendSuccess.value == true && state.sendSucceedType.value.toString() == widget.type) {
|
if (state.isSendSuccess.value == true &&
|
||||||
|
state.sendSucceedType.value.toString() == widget.type) {
|
||||||
return sendElectronicKeySucceed();
|
return sendElectronicKeySucceed();
|
||||||
} else {
|
} else {
|
||||||
switch (int.parse(widget.type)) {
|
switch (int.parse(widget.type)) {
|
||||||
@ -66,7 +67,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
keyTimeWidget(),
|
keyTimeWidget(),
|
||||||
remoteUnlockingWidget(),
|
remoteUnlockingWidget(),
|
||||||
keyRealNameWidget(),
|
keyRealNameWidget(),
|
||||||
keyBottomWidget()
|
keyBottomWidget(state.timeLimitTips)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -78,7 +79,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
keyInfoWidget(),
|
keyInfoWidget(),
|
||||||
remoteUnlockingWidget(),
|
remoteUnlockingWidget(),
|
||||||
keyRealNameWidget(),
|
keyRealNameWidget(),
|
||||||
keyBottomWidget()
|
keyBottomWidget(state.permanentTips)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -90,7 +91,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
keyInfoWidget(),
|
keyInfoWidget(),
|
||||||
remoteUnlockingWidget(),
|
remoteUnlockingWidget(),
|
||||||
keyRealNameWidget(),
|
keyRealNameWidget(),
|
||||||
keyBottomWidget()
|
keyBottomWidget(state.onceLimitTips)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -103,7 +104,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
keyPeriodValidityWidget(),
|
keyPeriodValidityWidget(),
|
||||||
remoteUnlockingWidget(),
|
remoteUnlockingWidget(),
|
||||||
keyRealNameWidget(),
|
keyRealNameWidget(),
|
||||||
keyBottomWidget()
|
keyBottomWidget(state.cycleLimitTips)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -144,7 +145,6 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
result as Map<String, dynamic>;
|
result as Map<String, dynamic>;
|
||||||
state.countryCode.value = result['code'];
|
state.countryCode.value = result['code'];
|
||||||
state.countryName.value = result['countryName'];
|
state.countryName.value = result['countryName'];
|
||||||
setState(() {});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -171,12 +171,10 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
action: () {
|
action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
onConfirm: (p) {
|
onConfirm: (p) {
|
||||||
setState(() {
|
state.selectEffectiveDate.value =
|
||||||
state.selectEffectiveDate.value =
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
state.effectiveDateTime.value =
|
||||||
state.effectiveDateTime.value =
|
DateTime.parse(state.selectEffectiveDate.value);
|
||||||
DateTime.parse(state.selectEffectiveDate.value);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
@ -186,12 +184,10 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
action: () {
|
action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
onConfirm: (p) {
|
onConfirm: (p) {
|
||||||
setState(() {
|
state.selectFailureDate.value =
|
||||||
state.selectFailureDate.value =
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
state.failureDateTime.value =
|
||||||
state.failureDateTime.value =
|
DateTime.parse(state.selectFailureDate.value);
|
||||||
DateTime.parse(state.selectFailureDate.value);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
@ -221,7 +217,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
Widget keyPeriodValidityWidget() {
|
Widget keyPeriodValidityWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: state.weekdaysList.value.isEmpty
|
rightTitle: state.weekdaysList.value.isEmpty
|
||||||
? ''
|
? ''
|
||||||
@ -238,7 +234,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
state.failureTimestamp.value =
|
state.failureTimestamp.value =
|
||||||
result['endDate'].millisecondsSinceEpoch;
|
result['endDate'].millisecondsSinceEpoch;
|
||||||
}
|
}
|
||||||
})),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
)
|
)
|
||||||
@ -246,7 +242,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget keyBottomWidget() {
|
Widget keyBottomWidget(String sendElectronicKeyTips) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -256,7 +252,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.sendKeyBottomTip!.tr,
|
sendElectronicKeyTips,
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
||||||
@ -411,7 +407,6 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
// if (entity.errorCode!.codeIsSuccessful) {
|
// if (entity.errorCode!.codeIsSuccessful) {
|
||||||
// print("标记为已入住成功啦啦啦啦啦");
|
// print("标记为已入住成功啦啦啦啦啦");
|
||||||
// Toast.show(msg: "标记成功");
|
// Toast.show(msg: "标记成功");
|
||||||
// setState(() {});
|
|
||||||
// } else {
|
// } else {
|
||||||
// Toast.show(msg: '操作失败');
|
// Toast.show(msg: '操作失败');
|
||||||
// }
|
// }
|
||||||
@ -423,7 +418,6 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("标记为已入住成功啦啦啦啦啦");
|
print("标记为已入住成功啦啦啦啦啦");
|
||||||
logic.showToast("标记成功");
|
logic.showToast("标记成功");
|
||||||
setState(() {});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,10 +455,18 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||||
hintText: tfStr,
|
hintText: tfStr,
|
||||||
hintStyle: TextStyle(fontSize: 22.sp),
|
hintStyle: TextStyle(fontSize: 22.sp),
|
||||||
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
focusedBorder: const OutlineInputBorder(
|
||||||
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
borderSide:
|
||||||
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
border: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
disabledBorder: const OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
|
enabledBorder: const OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(width: 0, color: Colors.transparent)),
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||||
),
|
),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@ -489,17 +491,15 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
Contact? currentContact =
|
Contact? currentContact =
|
||||||
await state.contactPicker.selectContact();
|
await state.contactPicker.selectContact();
|
||||||
setState(() {
|
state.contact = currentContact!;
|
||||||
state.contact = currentContact!;
|
if (currentContact.phoneNumbers!.isNotEmpty) {
|
||||||
if (currentContact.phoneNumbers!.isNotEmpty) {
|
state.emailOrPhoneController.text = currentContact
|
||||||
state.emailOrPhoneController.text = currentContact
|
.phoneNumbers![0]
|
||||||
.phoneNumbers![0]
|
.replaceAll(RegExp(r"\s+\b|\b\s"), "");
|
||||||
.replaceAll(RegExp(r"\s+\b|\b\s"), "");
|
}
|
||||||
}
|
if (currentContact.fullName!.isNotEmpty) {
|
||||||
if (currentContact.fullName!.isNotEmpty) {
|
state.keyNameController.text = currentContact.fullName!;
|
||||||
state.keyNameController.text = currentContact.fullName!;
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -512,15 +512,16 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
// 远程开锁
|
// 远程开锁
|
||||||
Widget remoteUnlockingWidget() {
|
Widget remoteUnlockingWidget() {
|
||||||
return Visibility(
|
return Visibility(
|
||||||
visible: state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false,
|
visible:
|
||||||
|
state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget:
|
rightWidget: SizedBox(
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _remoteSwitch(true)),
|
width: 60.w, height: 50.h, child: _remoteSwitch(true)),
|
||||||
action: () {}),
|
action: () {}),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
@ -537,13 +538,11 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
value:
|
value:
|
||||||
isRemote ? state.isRemoteUnlock.value : state.isAuthentication.value,
|
isRemote ? state.isRemoteUnlock.value : state.isAuthentication.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
if (isRemote) {
|
||||||
if (isRemote) {
|
state.isRemoteUnlock.value = !state.isRemoteUnlock.value;
|
||||||
state.isRemoteUnlock.value = !state.isRemoteUnlock.value;
|
} else {
|
||||||
} else {
|
state.isAuthentication.value = !state.isAuthentication.value;
|
||||||
state.isAuthentication.value = !state.isAuthentication.value;
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -639,14 +638,14 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
//微信好友
|
//微信好友
|
||||||
{
|
{
|
||||||
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
||||||
NativeInteractionTool.loadNativeShare(shareText:pwdShareStr);
|
NativeInteractionTool.loadNativeShare(shareText: pwdShareStr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
//短信
|
//短信
|
||||||
{
|
{
|
||||||
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
||||||
NativeInteractionTool.loadNativeShare(shareText:pwdShareStr);
|
NativeInteractionTool.loadNativeShare(shareText: pwdShareStr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@ -659,7 +658,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
//更多
|
//更多
|
||||||
{
|
{
|
||||||
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
String pwdShareStr = '您好,您的电子钥匙生成成功';
|
||||||
NativeInteractionTool.loadNativeShare(shareText:pwdShareStr);
|
NativeInteractionTool.loadNativeShare(shareText: pwdShareStr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -37,6 +37,11 @@ class SendElectronicKeyState {
|
|||||||
|
|
||||||
final sendSucceedType = 0.obs;
|
final sendSucceedType = 0.obs;
|
||||||
|
|
||||||
|
final timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
||||||
|
final permanentTips = '接收者可以使用此App开关锁'; //永久
|
||||||
|
final onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
||||||
|
final cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
||||||
|
|
||||||
SendElectronicKeyState() {
|
SendElectronicKeyState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
keyInfo.value = map["keyInfo"];
|
keyInfo.value = map["keyInfo"];
|
||||||
|
|||||||
@ -5,8 +5,8 @@ import 'package:flutter_reactive_ble/flutter_reactive_ble.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:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
import '../../../appRouters.dart';
|
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
import '../../../blue/io_protocol/io_addUser.dart';
|
import '../../../blue/io_protocol/io_addUser.dart';
|
||||||
@ -21,7 +21,6 @@ import '../../../network/api_repository.dart';
|
|||||||
import '../../../tools/baseGetXController.dart';
|
import '../../../tools/baseGetXController.dart';
|
||||||
import '../../../tools/eventBusEventManage.dart';
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../tools/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
import '../electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
|
||||||
import '../lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
import '../lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
||||||
import 'lockDetail_state.dart';
|
import 'lockDetail_state.dart';
|
||||||
import 'lockNetToken_entity.dart';
|
import 'lockNetToken_entity.dart';
|
||||||
@ -73,7 +72,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
// _showFullScreenOverlay(Get.context!);
|
// _showFullScreenOverlay(Get.context!);
|
||||||
|
|
||||||
state.iSClosedUnlockSuccessfulPopup.value = true;
|
state.iSClosedUnlockSuccessfulPopup.value = true;
|
||||||
if(state.closedUnlockSuccessfulTimer != null){
|
if (state.closedUnlockSuccessfulTimer != null) {
|
||||||
state.closedUnlockSuccessfulTimer!.cancel();
|
state.closedUnlockSuccessfulTimer!.cancel();
|
||||||
state.closedUnlockSuccessfulTimer = null;
|
state.closedUnlockSuccessfulTimer = null;
|
||||||
}
|
}
|
||||||
@ -135,10 +134,10 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case 0x16:
|
case 0x16:
|
||||||
// 正在开锁中...
|
// 正在开锁中...
|
||||||
print("${reply.commandType}正在开锁中...");
|
print("${reply.commandType}正在开锁中...");
|
||||||
state.openLockBtnState.value = 0;
|
state.openLockBtnState.value = 0;
|
||||||
showToast("正在开锁中...", something: (){
|
showToast("正在开锁中...", something: () {
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@ -370,13 +369,15 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 添加用户(普通用户接收电子钥匙)
|
// 添加用户(普通用户接收电子钥匙)
|
||||||
Future<void> addUserConnectBlue() async {
|
Future<void> addUserConnectBlue() async {
|
||||||
showBlueConnetctToastTimer(action:() {
|
showBlueConnetctToastTimer(action: () {
|
||||||
state.openLockBtnState.value = 0;
|
state.openLockBtnState.value = 0;
|
||||||
// state.animationController.reset();
|
// state.animationController.reset();
|
||||||
// state.animationController.forward();
|
// state.animationController.forward();
|
||||||
});
|
});
|
||||||
|
|
||||||
BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (DeviceConnectionState deviceConnectionState) async {
|
BlueManage()
|
||||||
|
.bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!,
|
||||||
|
(DeviceConnectionState deviceConnectionState) async {
|
||||||
if (deviceConnectionState == DeviceConnectionState.connected) {
|
if (deviceConnectionState == DeviceConnectionState.connected) {
|
||||||
// 私钥
|
// 私钥
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
@ -390,7 +391,8 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
if (token != null) {
|
if (token != null) {
|
||||||
getTokenList = changeStringListToIntList(token);
|
getTokenList = changeStringListToIntList(token);
|
||||||
}
|
}
|
||||||
print("BlueManage().connectDeviceName:${BlueManage().connectDeviceName} authUserID:${state.senderUserId.toString()} keyID:${state.keyInfos.value.keyId.toString()} userID:${await Storage.getUid()}");
|
print(
|
||||||
|
"BlueManage().connectDeviceName:${BlueManage().connectDeviceName} authUserID:${state.senderUserId.toString()} keyID:${state.keyInfos.value.keyId.toString()} userID:${await Storage.getUid()}");
|
||||||
IoSenderManage.senderAddUser(
|
IoSenderManage.senderAddUser(
|
||||||
lockID: BlueManage().connectDeviceName,
|
lockID: BlueManage().connectDeviceName,
|
||||||
authUserID: state.senderUserId.toString(),
|
authUserID: state.senderUserId.toString(),
|
||||||
@ -406,9 +408,9 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
publicKey: publicKeyDataList,
|
publicKey: publicKeyDataList,
|
||||||
privateKey: getPrivateKeyList,
|
privateKey: getPrivateKeyList,
|
||||||
token: getTokenList);
|
token: getTokenList);
|
||||||
}else if (deviceConnectionState == DeviceConnectionState.disconnected){
|
} else if (deviceConnectionState == DeviceConnectionState.disconnected) {
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,7 +423,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 点击开门事件
|
// 点击开门事件
|
||||||
Future<void> openDoorAction(int openMode) async {
|
Future<void> openDoorAction(int openMode) async {
|
||||||
showBlueConnetctToastTimer(action:() {
|
showBlueConnetctToastTimer(action: () {
|
||||||
state.openLockBtnState.value = 0;
|
state.openLockBtnState.value = 0;
|
||||||
BlueManage().stopScan();
|
BlueManage().stopScan();
|
||||||
|
|
||||||
@ -437,7 +439,8 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
var token = await Storage.getStringList(saveBlueToken);
|
var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
print("openDoorTokenPubToken:$getTokenList getPrivateKeyList:$getPrivateKeyList");
|
print(
|
||||||
|
"openDoorTokenPubToken:$getTokenList getPrivateKeyList:$getPrivateKeyList");
|
||||||
// List<int>listData = await IoSenderManage.senderOpenLock(
|
// List<int>listData = await IoSenderManage.senderOpenLock(
|
||||||
// keyID: BlueManage().connectDeviceName,
|
// keyID: BlueManage().connectDeviceName,
|
||||||
// userID: await Storage.getUid(),
|
// userID: await Storage.getUid(),
|
||||||
@ -449,8 +452,10 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
// signKey: signKeyDataList,
|
// signKey: signKeyDataList,
|
||||||
// privateKey: getPrivateKeyList,
|
// privateKey: getPrivateKeyList,
|
||||||
// );
|
// );
|
||||||
BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (DeviceConnectionState deviceConnectionState) async {
|
BlueManage()
|
||||||
if (deviceConnectionState == DeviceConnectionState.connected){
|
.bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!,
|
||||||
|
(DeviceConnectionState deviceConnectionState) async {
|
||||||
|
if (deviceConnectionState == DeviceConnectionState.connected) {
|
||||||
IoSenderManage.senderOpenLock(
|
IoSenderManage.senderOpenLock(
|
||||||
keyID: BlueManage().connectDeviceName,
|
keyID: BlueManage().connectDeviceName,
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
@ -462,9 +467,9 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey: getPrivateKeyList,
|
privateKey: getPrivateKeyList,
|
||||||
);
|
);
|
||||||
}else if (deviceConnectionState == DeviceConnectionState.disconnected){
|
} else if (deviceConnectionState == DeviceConnectionState.disconnected) {
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,10 +542,11 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
// 获取锁状态 更新电量
|
// 获取锁状态 更新电量
|
||||||
Future<void> getStarLockStatus() async {
|
Future<void> getStarLockStatus() async {
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
});
|
});
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState deviceConnectionState) async {
|
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||||
|
(DeviceConnectionState deviceConnectionState) async {
|
||||||
if (deviceConnectionState == DeviceConnectionState.connected) {
|
if (deviceConnectionState == DeviceConnectionState.connected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
@ -553,7 +559,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
} else if (deviceConnectionState == DeviceConnectionState.disconnected) {
|
} else if (deviceConnectionState == DeviceConnectionState.disconnected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -591,7 +597,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//
|
//
|
||||||
startOpenLock() {
|
startOpenLock() {
|
||||||
if(state.openLockBtnState.value == 1){
|
if (state.openLockBtnState.value == 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.iSOpenLock.value = true;
|
state.iSOpenLock.value = true;
|
||||||
@ -614,7 +620,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startUnLock() {
|
startUnLock() {
|
||||||
if(state.openLockBtnState.value == 1){
|
if (state.openLockBtnState.value == 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.iSOpenLock.value = false;
|
state.iSOpenLock.value = false;
|
||||||
@ -672,7 +678,8 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
||||||
void getLockNetToken() async {
|
void getLockNetToken() async {
|
||||||
LockNetTokenEntity entity = await ApiRepository.to.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
LockNetTokenEntity entity = await ApiRepository.to
|
||||||
|
.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.lockNetToken = entity.data!.token!;
|
state.lockNetToken = entity.data!.token!;
|
||||||
print("state.lockNetToken:${state.lockNetToken}");
|
print("state.lockNetToken:${state.lockNetToken}");
|
||||||
@ -698,7 +705,9 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 查询锁记录最后时间
|
// 查询锁记录最后时间
|
||||||
void getLockRecordLastUploadDataTime() async {
|
void getLockRecordLastUploadDataTime() async {
|
||||||
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to.getLockRecordLastUploadDataTime(lockId: state.keyInfos.value.lockId.toString());
|
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to
|
||||||
|
.getLockRecordLastUploadDataTime(
|
||||||
|
lockId: state.keyInfos.value.lockId.toString());
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
senderReferEventRecordTime(entity.data!.operateDate! ~/ 1000);
|
senderReferEventRecordTime(entity.data!.operateDate! ~/ 1000);
|
||||||
}
|
}
|
||||||
@ -716,27 +725,34 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//电量更新请求
|
//电量更新请求
|
||||||
Future<void> uploadElectricQuantityRequest(String electricQuantity) async {
|
Future<void> uploadElectricQuantityRequest(String electricQuantity) async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(electricQuantity, state.keyInfos.value.lockId.toString());
|
KeyOperationRecordEntity entity = await ApiRepository.to
|
||||||
|
.uploadElectricQuantity(
|
||||||
|
electricQuantity, state.keyInfos.value.lockId.toString());
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast("电量更新成功", something: (){
|
showToast("电量更新成功", something: () {
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 锁设置里面开启关闭考勤刷新锁详情
|
/// 锁设置里面开启关闭考勤刷新锁详情
|
||||||
StreamSubscription?
|
StreamSubscription?
|
||||||
_lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent;
|
_lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent;
|
||||||
void _initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() {
|
void _initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() {
|
||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
_lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent = eventBus.on<LockSetChangeSetRefreshLockDetailWithType>().listen((event) {
|
_lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent = eventBus
|
||||||
|
.on<LockSetChangeSetRefreshLockDetailWithType>()
|
||||||
|
.listen((event) {
|
||||||
if (event.type == 0) {
|
if (event.type == 0) {
|
||||||
// 0考勤
|
// 0考勤
|
||||||
state.isAttendance.value = int.parse(event.setResult);
|
state.isAttendance.value = int.parse(event.setResult);
|
||||||
state.keyInfos.value.lockSetting!.attendance = int.parse(event.setResult);
|
state.keyInfos.value.lockSetting!.attendance =
|
||||||
|
int.parse(event.setResult);
|
||||||
} else if (event.type == 1) {
|
} else if (event.type == 1) {
|
||||||
// 1 开锁时是否需联网
|
// 1 开锁时是否需联网
|
||||||
state.isOpenLockNeedOnline.value = int.parse(event.setResult);
|
state.isOpenLockNeedOnline.value = int.parse(event.setResult);
|
||||||
state.keyInfos.value.lockSetting!.appUnlockOnline = int.parse(event.setResult);
|
state.keyInfos.value.lockSetting!.appUnlockOnline =
|
||||||
|
int.parse(event.setResult);
|
||||||
} else if (event.type == 2) {
|
} else if (event.type == 2) {
|
||||||
// 2 常开模式
|
// 2 常开模式
|
||||||
state.isOpenPassageMode.value = int.parse(event.setResult);
|
state.isOpenPassageMode.value = int.parse(event.setResult);
|
||||||
@ -753,13 +769,22 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
late StreamSubscription<List<DiscoveredDevice>>_scanListDiscoveredDeviceSubscription;
|
late StreamSubscription<List<DiscoveredDevice>>
|
||||||
|
_scanListDiscoveredDeviceSubscription;
|
||||||
void _scanListDiscoveredDeviceSubscriptionAction() {
|
void _scanListDiscoveredDeviceSubscriptionAction() {
|
||||||
_scanListDiscoveredDeviceSubscription = EventBusManager().eventBus!.on<List<DiscoveredDevice>>().listen((List<DiscoveredDevice> list) {
|
_scanListDiscoveredDeviceSubscription = EventBusManager()
|
||||||
final knownDeviceIndex = list.indexWhere((d) => d.name == state.keyInfos.value.bluetooth!.bluetoothDeviceName!);
|
.eventBus!
|
||||||
|
.on<List<DiscoveredDevice>>()
|
||||||
|
.listen((List<DiscoveredDevice> list) {
|
||||||
|
final knownDeviceIndex = list.indexWhere((d) =>
|
||||||
|
d.name == state.keyInfos.value.bluetooth!.bluetoothDeviceName!);
|
||||||
if (knownDeviceIndex >= 0) {
|
if (knownDeviceIndex >= 0) {
|
||||||
// 存在的时候赋值
|
// 存在的时候赋值
|
||||||
state.currentDeviceUUid.value = (list[knownDeviceIndex].serviceUuids.isNotEmpty ? list[knownDeviceIndex].serviceUuids[0] : "").toString();
|
state.currentDeviceUUid.value =
|
||||||
|
(list[knownDeviceIndex].serviceUuids.isNotEmpty
|
||||||
|
? list[knownDeviceIndex].serviceUuids[0]
|
||||||
|
: "")
|
||||||
|
.toString();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -767,7 +792,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
//开锁成功弹出的小界面
|
//开锁成功弹出的小界面
|
||||||
void _showFullScreenOverlay(BuildContext context) {
|
void _showFullScreenOverlay(BuildContext context) {
|
||||||
Future.delayed(const Duration(seconds: 3), () {
|
Future.delayed(const Duration(seconds: 3), () {
|
||||||
if(state.iSClosedUnlockSuccessfulPopup.value != true){
|
if (state.iSClosedUnlockSuccessfulPopup.value != true) {
|
||||||
state.iSClosedUnlockSuccessfulPopup.value = true;
|
state.iSClosedUnlockSuccessfulPopup.value = true;
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
@ -779,7 +804,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if(state.iSClosedUnlockSuccessfulPopup.value != true){
|
if (state.iSClosedUnlockSuccessfulPopup.value != true) {
|
||||||
state.iSClosedUnlockSuccessfulPopup.value = true;
|
state.iSClosedUnlockSuccessfulPopup.value = true;
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
|
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
|
||||||
@ -12,7 +13,6 @@ import '../../../blue/sender_manage.dart';
|
|||||||
import '../../../network/api_repository.dart';
|
import '../../../network/api_repository.dart';
|
||||||
import '../../../tools/baseGetXController.dart';
|
import '../../../tools/baseGetXController.dart';
|
||||||
import '../../../tools/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
import '../electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
|
||||||
import 'lockOperatingRecordGetLastRecordTime_entity.dart';
|
import 'lockOperatingRecordGetLastRecordTime_entity.dart';
|
||||||
import 'lockOperatingRecord_state.dart';
|
import 'lockOperatingRecord_state.dart';
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
|
|
||||||
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:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../tools/custom_bottom_sheet.dart';
|
import '../../../tools/custom_bottom_sheet.dart';
|
||||||
@ -26,7 +25,6 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
@ -34,38 +32,39 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
actionsList: [
|
||||||
(state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1)
|
(state.keyInfos.value.isLockOwner == 1 ||
|
||||||
? IconButton(
|
state.keyInfos.value.keyRight == 1)
|
||||||
icon: Image.asset(
|
? IconButton(
|
||||||
'images/icon_bar_more.png',
|
icon: Image.asset(
|
||||||
height: 30.h,
|
'images/icon_bar_more.png',
|
||||||
width: 10.w,
|
height: 30.h,
|
||||||
),
|
width: 10.w,
|
||||||
onPressed: () async {
|
),
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
onPressed: () async {
|
||||||
if(isDemoMode == false){
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
// JhPopMenus.showLinePop(context, clickCallback: (index, selText) {
|
if (isDemoMode == false) {
|
||||||
// print('选中index: $index');
|
// JhPopMenus.showLinePop(context, clickCallback: (index, selText) {
|
||||||
// print('选中text: $selText');
|
// print('选中index: $index');
|
||||||
// if (index == 0) {
|
// print('选中text: $selText');
|
||||||
// logic.mockNetworkDataRequest();
|
// if (index == 0) {
|
||||||
// } else if (index == 1) {
|
// logic.mockNetworkDataRequest();
|
||||||
// logic.clearOperationRecordRequest();
|
// } else if (index == 1) {
|
||||||
// }
|
// logic.clearOperationRecordRequest();
|
||||||
// }, listData: [
|
// }
|
||||||
// {'text': '读取记录'},
|
// }, listData: [
|
||||||
// {'text': '清空记录'},
|
// {'text': '读取记录'},
|
||||||
// {'text': '导出记录'},
|
// {'text': '清空记录'},
|
||||||
// ]);
|
// {'text': '导出记录'},
|
||||||
|
// ]);
|
||||||
|
|
||||||
_openModalBottomSheet();
|
_openModalBottomSheet();
|
||||||
}else{
|
} else {
|
||||||
// Get.toNamed(Routers.selectLockTypePage);
|
// Get.toNamed(Routers.selectLockTypePage);
|
||||||
logic.showToast("演示模式");
|
logic.showToast("演示模式");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: Container(),
|
: Container(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
@ -79,9 +78,7 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
_searchWidget(),
|
_searchWidget(),
|
||||||
SizedBox(
|
SizedBox(height: 10.h),
|
||||||
height: 10.h
|
|
||||||
),
|
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(child: _buildMainUI()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -124,24 +121,28 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMainUI() {
|
Widget _buildMainUI() {
|
||||||
return Obx(() => state.lockOperatingRecordListData.value.isNotEmpty ? ListView.separated(
|
return Obx(() => state.lockOperatingRecordListData.value.isNotEmpty
|
||||||
itemCount: state.lockOperatingRecordListData.length,
|
? ListView.separated(
|
||||||
itemBuilder: (c, index) {
|
itemCount: state.lockOperatingRecordListData.length,
|
||||||
KeyRecordDataItem dataItem = state.lockOperatingRecordListData[index];
|
itemBuilder: (c, index) {
|
||||||
int? operateDate = dataItem.operateDate;
|
KeyRecordDataItem dataItem =
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(operateDate!);
|
state.lockOperatingRecordListData[index];
|
||||||
String operateDateStr = '${dateStr.toLocal().toString().substring(0, 16)} ';
|
int? operateDate = dataItem.operateDate;
|
||||||
return _operatingRecordItem(getTypeIcon(dataItem.recordType!), dataItem.recordTypeName!, operateDateStr, () {
|
DateTime dateStr =
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(operateDate!);
|
||||||
});
|
String operateDateStr =
|
||||||
},
|
'${dateStr.toLocal().toString().substring(0, 16)} ';
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
return _operatingRecordItem(getTypeIcon(dataItem.recordType!),
|
||||||
return const Divider(
|
dataItem.recordTypeName!, operateDateStr, () {});
|
||||||
height: 1,
|
},
|
||||||
color: AppColors.greyLineColor,
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
);
|
return const Divider(
|
||||||
},
|
height: 1,
|
||||||
) : NoData());
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: NoData());
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _dateItem(String lockDate) {
|
Widget _dateItem(String lockDate) {
|
||||||
@ -185,7 +186,8 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _operatingRecordItem(String userAvatarStr, String userNameStr, String unlockDescStr, Function() action) {
|
Widget _operatingRecordItem(String userAvatarStr, String userNameStr,
|
||||||
|
String unlockDescStr, Function() action) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: action,
|
onTap: action,
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -261,5 +263,4 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
import '../../lockMian/entity/lockListInfo_entity.dart';
|
import '../../lockMian/entity/lockListInfo_entity.dart';
|
||||||
import '../electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
|
||||||
|
|
||||||
class LockOperatingRecordState{
|
class LockOperatingRecordState {
|
||||||
final keyInfos = LockListInfoItemEntity().obs;
|
final keyInfos = LockListInfoItemEntity().obs;
|
||||||
final lockOperatingRecordListData = <KeyRecordDataItem>[].obs;
|
final lockOperatingRecordListData = <KeyRecordDataItem>[].obs;
|
||||||
LockOperatingRecordState() {
|
LockOperatingRecordState() {
|
||||||
keyInfos.value = Get.arguments["keyInfo"];
|
keyInfos.value = Get.arguments["keyInfo"];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -1,31 +1,28 @@
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
import '../../../../../network/api_repository.dart';
|
import '../../../../../network/api_repository.dart';
|
||||||
import '../../../../../tools/baseGetXController.dart';
|
import '../../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
|
||||||
import 'editLockName_state.dart';
|
import 'editLockName_state.dart';
|
||||||
|
|
||||||
class EditLockNameLogic extends BaseGetXController{
|
class EditLockNameLogic extends BaseGetXController {
|
||||||
final EditLockNameState state = EditLockNameState();
|
final EditLockNameState state = EditLockNameState();
|
||||||
|
|
||||||
//修改锁名称请求
|
//修改锁名称请求
|
||||||
Future<void> modifyKeyNameRequest() async {
|
Future<void> modifyKeyNameRequest() async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.updateLockName(
|
KeyOperationRecordEntity entity = await ApiRepository.to.updateLockName(
|
||||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
lockId: state.lockSetInfoData.value.lockId.toString(),
|
||||||
lockName:state.changeLockNameController.text);
|
lockName: state.changeLockNameController.text);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text;
|
state.lockBasicInfo.value.lockAlias = state.changeLockNameController.text;
|
||||||
showToast("修改成功", something: (){
|
showToast("修改成功", something: () {
|
||||||
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(3, state.lockBasicInfo.value.lockAlias!));
|
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(
|
||||||
|
3, state.lockBasicInfo.value.lockAlias!));
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
});
|
});
|
||||||
|
|
||||||
Get.back(result: {
|
Get.back(result: {"lockBasicInfo": state.lockBasicInfo.value});
|
||||||
"lockBasicInfo":state.lockBasicInfo.value
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
import '../../../../../blue/blue_manage.dart';
|
import '../../../../../blue/blue_manage.dart';
|
||||||
import '../../../../../blue/io_protocol/io_getStarLockStatusInfo.dart';
|
import '../../../../../blue/io_protocol/io_getStarLockStatusInfo.dart';
|
||||||
@ -13,7 +13,6 @@ import '../../../../../network/api_repository.dart';
|
|||||||
import '../../../../../tools/baseGetXController.dart';
|
import '../../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../../../tools/storage.dart';
|
import '../../../../../tools/storage.dart';
|
||||||
import '../../../electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
|
||||||
import 'uploadElectricQuantity_state.dart';
|
import 'uploadElectricQuantity_state.dart';
|
||||||
|
|
||||||
class UploadElectricQuantityLogic extends BaseGetXController {
|
class UploadElectricQuantityLogic extends BaseGetXController {
|
||||||
@ -21,12 +20,15 @@ class UploadElectricQuantityLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//电量更新请求
|
//电量更新请求
|
||||||
Future<void> uploadElectricQuantityRequest(String electricQuantity) async {
|
Future<void> uploadElectricQuantityRequest(String electricQuantity) async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(electricQuantity, state.lockSetInfoData.value.lockId.toString());
|
KeyOperationRecordEntity entity = await ApiRepository.to
|
||||||
|
.uploadElectricQuantity(
|
||||||
|
electricQuantity, state.lockSetInfoData.value.lockId.toString());
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
showToast("锁电量更新成功", something: () {
|
||||||
showToast("锁电量更新成功", something: (){
|
eventBus
|
||||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||||
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, electricQuantity));
|
eventBus.fire(
|
||||||
|
LockSetChangeSetRefreshLockDetailWithType(0, electricQuantity));
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -34,17 +36,18 @@ class UploadElectricQuantityLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 获取锁状态
|
// 获取锁状态
|
||||||
Future<void> getStarLockStatus() async {
|
Future<void> getStarLockStatus() async {
|
||||||
if(state.sureBtnState.value == 1){
|
if (state.sureBtnState.value == 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.sureBtnState.value = 1;
|
state.sureBtnState.value = 1;
|
||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
});
|
});
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState deviceConnectionState) async {
|
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||||
|
(DeviceConnectionState deviceConnectionState) async {
|
||||||
if (deviceConnectionState == DeviceConnectionState.connected) {
|
if (deviceConnectionState == DeviceConnectionState.connected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
@ -58,7 +61,7 @@ class UploadElectricQuantityLogic extends BaseGetXController {
|
|||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -68,7 +71,8 @@ class UploadElectricQuantityLogic extends BaseGetXController {
|
|||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
_replySubscription =
|
||||||
|
EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||||
// 获取锁状态信息
|
// 获取锁状态信息
|
||||||
if (reply is GetStarLockStatuInfoReply) {
|
if (reply is GetStarLockStatuInfoReply) {
|
||||||
_replyGetStarLockStatusInfo(reply);
|
_replyGetStarLockStatusInfo(reply);
|
||||||
@ -81,7 +85,7 @@ class UploadElectricQuantityLogic extends BaseGetXController {
|
|||||||
int status = reply.data[2];
|
int status = reply.data[2];
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
print("${reply.commandType}数据解析成功");
|
print("${reply.commandType}数据解析成功");
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
@ -89,28 +93,31 @@ class UploadElectricQuantityLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 电池剩余电量
|
// 电池剩余电量
|
||||||
var battRemCap = reply.data[132];
|
var battRemCap = reply.data[132];
|
||||||
state.lockSetInfoData.value.lockBasicInfo!.electricQuantity = battRemCap;
|
state.lockSetInfoData.value.lockBasicInfo!.electricQuantity =
|
||||||
state.uploadElectricQuantityDate.value = DateTime.now().millisecondsSinceEpoch;
|
battRemCap;
|
||||||
state.lockSetInfoData.value.lockBasicInfo!.electricQuantityDate = DateTime.now().millisecondsSinceEpoch;
|
state.uploadElectricQuantityDate.value =
|
||||||
|
DateTime.now().millisecondsSinceEpoch;
|
||||||
|
state.lockSetInfoData.value.lockBasicInfo!.electricQuantityDate =
|
||||||
|
DateTime.now().millisecondsSinceEpoch;
|
||||||
uploadElectricQuantityRequest(battRemCap.toString());
|
uploadElectricQuantityRequest(battRemCap.toString());
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
print("${reply.commandType}需要鉴权");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 0x07:
|
case 0x07:
|
||||||
//无权限
|
//无权限
|
||||||
print("${reply.commandType}用户无权限");
|
print("${reply.commandType}用户无权限");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 0x09:
|
case 0x09:
|
||||||
// 权限校验错误
|
// 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
print("${reply.commandType}权限校验错误");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
print("${reply.commandType}失败");
|
print("${reply.commandType}失败");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -139,5 +146,4 @@ class UploadElectricQuantityLogic extends BaseGetXController {
|
|||||||
super.onClose();
|
super.onClose();
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.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/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
@ -108,7 +108,7 @@ class _ExpireLockChangeDatePageState extends State<ExpireLockChangeDatePage> {
|
|||||||
'', []);
|
'', []);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("修改要是名称成功啦啦啦啦啦");
|
print("修改要是名称成功啦啦啦啦啦");
|
||||||
EasyLoading.showToast('修改成功',duration: 2000.milliseconds);
|
EasyLoading.showToast('修改成功', duration: 2000.milliseconds);
|
||||||
setState(() {
|
setState(() {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||||
|
|||||||
@ -127,6 +127,7 @@ class _XSDropDownWidgetState extends State<XSDropDownWidget> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
item.itemTitle,
|
item.itemTitle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp,
|
||||||
color: item.itemValue == currentValue
|
color: item.itemValue == currentValue
|
||||||
? Colors.white
|
? Colors.white
|
||||||
: Colors.black, // 设置选中项文字颜色为白色
|
: Colors.black, // 设置选中项文字颜色为白色
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user