升级flutter版本3.19.6
This commit is contained in:
parent
19221dc666
commit
6daf8a45f0
@ -1,5 +1,6 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
|
||||
import '../../../../tools/commonDataManage.dart';
|
||||
|
||||
@ -13,6 +14,7 @@ class AddICCardState{ // 0永久 1显示 2循环
|
||||
cardNumber.value = map['cardNumber'];
|
||||
cardType.value = map['cardType'];
|
||||
isCoerced.value = map['isCoerced'];
|
||||
AppLog.log('1111-isCoerced.value:${isCoerced.value}');
|
||||
isAdministrator.value = map['isAdministrator'];
|
||||
startDate.value = map['startDate'];
|
||||
weekDay.value = map['weekDay'];
|
||||
|
||||
@ -4,6 +4,8 @@ import 'dart:async';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/addFace/addFace_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/addFace/addFace_state.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
|
||||
@ -23,7 +25,7 @@ class AddFaceLogic extends BaseGetXController {
|
||||
// 监听设备返回的数据
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
// 添加人脸开始
|
||||
if (reply is SenderAddFaceReply && state.ifCurrentScreen.value == true) {
|
||||
_replyAddFaceBegin(reply);
|
||||
@ -42,7 +44,7 @@ class AddFaceLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
Future<void> _replyAddFaceBegin(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
final int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
@ -55,25 +57,25 @@ class AddFaceLogic extends BaseGetXController {
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
final List<int> token = reply.data.sublist(5, 9);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID:"1",
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:0,
|
||||
useCountLimit:0xffff,
|
||||
isForce:state.isCoerced.value == "2" ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == "2" ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '2' ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
operate: 0,
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
@ -89,7 +91,7 @@ class AddFaceLogic extends BaseGetXController {
|
||||
default:
|
||||
//失败
|
||||
state.ifAddState.value = false;
|
||||
showToast("添加人脸失败", something: (){
|
||||
showToast('添加人脸失败', something: (){
|
||||
Get.back();
|
||||
});
|
||||
break;
|
||||
@ -97,38 +99,38 @@ class AddFaceLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
Future<void> _replyAddFaceProcess(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
final int status = reply.data[2];
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
switch(reply.data[5]){
|
||||
case 0xff:
|
||||
// 注册人脸失败
|
||||
showToast("退出添加".tr);
|
||||
showToast('退出添加'.tr);
|
||||
state.ifAddState.value = false;
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFE:
|
||||
// 管理员已满
|
||||
showToast("管理员已满".tr);
|
||||
showToast('管理员已满'.tr);
|
||||
state.ifAddState.value = false;
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFD:
|
||||
// 用户已满
|
||||
showToast("用户已满".tr);
|
||||
showToast('用户已满'.tr);
|
||||
state.ifAddState.value = false;
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFC:
|
||||
// 指纹已满
|
||||
showToast("锁上面添加人脸已满".tr);
|
||||
showToast('锁上面添加人脸已满'.tr);
|
||||
state.ifAddState.value = false;
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFB:
|
||||
// 指纹已存在
|
||||
showToast("人脸已存在".tr);
|
||||
showToast('人脸已存在'.tr);
|
||||
state.ifAddState.value = false;
|
||||
break;
|
||||
default:
|
||||
@ -159,12 +161,12 @@ class AddFaceLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
Future<void> _replyAddFaceConfirmation(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
final int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
var faceList = reply.data.sublist(reply.data.length - 2);
|
||||
var faceNumber = listChangInt(faceList).toString();
|
||||
final List<int> faceList = reply.data.sublist(reply.data.length - 2);
|
||||
final String faceNumber = listChangInt(faceList).toString();
|
||||
// var faceNumber = listChangInt(reply.data.sublist(6, 7)).toString();
|
||||
// if (state.faceNumber.value == (reply.data[6]).toString()) {
|
||||
if (state.faceNumber.value == faceNumber) {
|
||||
@ -192,24 +194,24 @@ class AddFaceLogic extends BaseGetXController {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID:"1",
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:0,
|
||||
useCountLimit:0xffff,
|
||||
isForce:state.isCoerced.value == "2" ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == "2" ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '2' ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
operate: 0,
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
@ -235,17 +237,17 @@ class AddFaceLogic extends BaseGetXController {
|
||||
Future<void> senderCancelAddFaceCommand() async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderCancelAddFaceCommand(
|
||||
keyID:"1",
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
@ -263,8 +265,8 @@ class AddFaceLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 添加人脸
|
||||
void addFaceData() async {
|
||||
var entity = await ApiRepository.to.addFaceData(
|
||||
Future<void> addFaceData() async {
|
||||
final AddFaceEntity entity = await ApiRepository.to.addFaceData(
|
||||
lockId: state.lockId.value,
|
||||
faceName: state.faceName.value,
|
||||
faceNumber: state.faceNumber.value,
|
||||
@ -276,7 +278,7 @@ class AddFaceLogic extends BaseGetXController {
|
||||
weekDay: state.weekDay.value,
|
||||
startTime: int.parse(state.effectiveDateTime.value),
|
||||
endTime: int.parse(state.failureDateTime.value),
|
||||
faceRight: state.isAdministrator.value == "2" ? 1 : 0,
|
||||
faceRight: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
);
|
||||
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
@ -286,14 +288,14 @@ class AddFaceLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 更新人脸用户账号
|
||||
void updateFaceUserNoLoadData(int faceId) async {
|
||||
var entity = await ApiRepository.to.updateFaceUserNo(
|
||||
Future<void> updateFaceUserNoLoadData(int faceId) async {
|
||||
final LoginEntity entity = await ApiRepository.to.updateFaceUserNo(
|
||||
faceId: faceId,
|
||||
lockId: state.lockId.value,
|
||||
faceUserNo: state.faceNumber.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("添加成功");
|
||||
showToast('添加成功');
|
||||
if (state.fromType.value == 2) {
|
||||
// 回调人脸号
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(
|
||||
@ -307,7 +309,6 @@ class AddFaceLogic extends BaseGetXController {
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
_initReplySubscription();
|
||||
@ -315,7 +316,6 @@ class AddFaceLogic extends BaseGetXController {
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
//开始添加后发送指令
|
||||
// senderAddFace();
|
||||
@ -323,7 +323,6 @@ class AddFaceLogic extends BaseGetXController {
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
|
||||
_replySubscription.cancel();
|
||||
|
||||
@ -75,7 +75,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:0,
|
||||
useCountLimit:0xffff,
|
||||
isForce:state.isCoerced.value == '2' ? 1 : 0, // 是否是胁迫
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
operate: 0,
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
@ -203,7 +203,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:0,
|
||||
useCountLimit:0xffff,
|
||||
isForce:state.isCoerced.value == '2' ? 1 : 0, // 是否是胁迫
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
operate: 0,
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
|
||||
@ -3,50 +3,49 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
|
||||
class AddFingerprintState{
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
var ifAddState = false.obs;// 是否是添加状态,如果是添加状态,返回上级界面发送取消添加指令
|
||||
|
||||
var ifConnectScuess = false.obs;
|
||||
var maxRegCount = 0.obs;// 最大注册次数
|
||||
var regIndex = 0.obs;// 当前注册次数
|
||||
|
||||
var fingerprintNumber = "".obs;
|
||||
|
||||
final lockId = 0.obs;
|
||||
final endDate = "".obs;
|
||||
final addType = "".obs;
|
||||
final fingerprintName = "".obs;
|
||||
final fingerprintType = "".obs;
|
||||
final isCoerced = "".obs;
|
||||
final isAdministrator = "".obs;
|
||||
final startDate = "".obs;
|
||||
final weekDay = [].obs;
|
||||
final fromType = 1.obs;
|
||||
final effectiveDateTime = "".obs; // 生效时间
|
||||
final failureDateTime = "".obs; // 失效时间
|
||||
final selectType = "0".obs; // 0永久 1显示 2循环
|
||||
|
||||
AddFingerprintState() {
|
||||
Map map = Get.arguments;
|
||||
lockId.value = map["lockId"];
|
||||
addType.value = map["addType"];
|
||||
fingerprintName.value = map["fingerprintName"];
|
||||
fingerprintType.value = map["fingerprintType"];
|
||||
isCoerced.value = map["isCoerced"];
|
||||
isAdministrator.value = map["isAdministrator"];
|
||||
startDate.value = map["startDate"];
|
||||
lockId.value = map["lockId"];
|
||||
weekDay.value = map["weekDay"];
|
||||
fromType.value = map["fromType"];
|
||||
effectiveDateTime.value = map["effectiveTime"];
|
||||
failureDateTime.value = map["failureTime"];
|
||||
selectType.value = map["selectType"];
|
||||
lockId.value = map['lockId'];
|
||||
addType.value = map['addType'];
|
||||
fingerprintName.value = map['fingerprintName'];
|
||||
fingerprintType.value = map['fingerprintType'];
|
||||
isCoerced.value = map['isCoerced'];
|
||||
isAdministrator.value = map['isAdministrator'];
|
||||
startDate.value = map['startDate'];
|
||||
lockId.value = map['lockId'];
|
||||
weekDay.value = map['weekDay'];
|
||||
fromType.value = map['fromType'];
|
||||
effectiveDateTime.value = map['effectiveTime'];
|
||||
failureDateTime.value = map['failureTime'];
|
||||
selectType.value = map['selectType'];
|
||||
//循环类型下,结束时间加一天
|
||||
if (selectType.value == '2') {
|
||||
endDate.value =
|
||||
"${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
|
||||
} else {
|
||||
endDate.value = map["endDate"];
|
||||
endDate.value = map['endDate'];
|
||||
}
|
||||
}
|
||||
RxBool ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
RxBool ifAddState = false.obs;// 是否是添加状态,如果是添加状态,返回上级界面发送取消添加指令
|
||||
|
||||
RxBool ifConnectScuess = false.obs;
|
||||
RxInt maxRegCount = 0.obs;// 最大注册次数
|
||||
RxInt regIndex = 0.obs;// 当前注册次数
|
||||
|
||||
RxString fingerprintNumber = ''.obs;
|
||||
|
||||
final RxInt lockId = 0.obs;
|
||||
final RxString endDate = ''.obs;
|
||||
final RxString addType = ''.obs;
|
||||
final RxString fingerprintName = ''.obs;
|
||||
final RxString fingerprintType = ''.obs;
|
||||
final RxString isCoerced = ''.obs;
|
||||
final RxString isAdministrator = ''.obs;
|
||||
final RxString startDate = ''.obs;
|
||||
final RxList weekDay = [].obs;
|
||||
final RxInt fromType = 1.obs;
|
||||
final RxString effectiveDateTime = ''.obs; // 生效时间
|
||||
final RxString failureDateTime = ''.obs; // 失效时间
|
||||
final RxString selectType = '0'.obs;// 0永久 1显示 2循环
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
@ -10,31 +11,31 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
AddFingerprintState state = AddFingerprintState();
|
||||
|
||||
// 添加指纹
|
||||
void addFingerprintsData() async {
|
||||
var fingerprintType = 0; // 永久:1;限时2,单次3,循环:4
|
||||
var startDate = "";
|
||||
var endDate = "";
|
||||
var startTime = "";
|
||||
var endTime = "";
|
||||
if (state.selectType.value == "0") {
|
||||
Future<void> addFingerprintsData() async {
|
||||
int fingerprintType = 0; // 永久:1;限时2,单次3,循环:4
|
||||
String startDate = '';
|
||||
String endDate = '';
|
||||
String startTime = '';
|
||||
String endTime = '';
|
||||
if (state.selectType.value == '0') {
|
||||
fingerprintType = 1;
|
||||
startDate = "0";
|
||||
endDate = "0";
|
||||
startTime = "0";
|
||||
endTime = "0";
|
||||
} else if (state.selectType.value == "1") {
|
||||
startDate = '0';
|
||||
endDate = '0';
|
||||
startTime = '0';
|
||||
endTime = '0';
|
||||
} else if (state.selectType.value == '1') {
|
||||
fingerprintType = 2;
|
||||
startDate = DateTool().dateToTimestamp(state.timeLimitBeginTime.value, 1).toString();
|
||||
endDate = DateTool().dateToTimestamp(state.timeLimitEndTime.value, 1).toString();
|
||||
startTime = "0";
|
||||
endTime = "0";
|
||||
startTime = '0';
|
||||
endTime = '0';
|
||||
|
||||
if (startDate.isEmpty) {
|
||||
showToast("请选择开始时间".tr);
|
||||
showToast('请选择开始时间'.tr);
|
||||
return;
|
||||
}
|
||||
if (endDate.isEmpty) {
|
||||
showToast("请选择结束时间".tr);
|
||||
showToast('请选择结束时间'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -44,12 +45,12 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
// }
|
||||
|
||||
if (int.parse(startDate) >= int.parse(endDate)) {
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
showToast('失效时间要大于生效时间'.tr);
|
||||
return;
|
||||
}
|
||||
} else if (state.selectType.value == "2") {
|
||||
} else if (state.selectType.value == '2') {
|
||||
if (state.cycleBeginTime.value.isEmpty) {
|
||||
showToast("请选择有效期".tr);
|
||||
showToast('请选择有效期'.tr);
|
||||
return;
|
||||
}
|
||||
startDate = DateTool().dateToTimestamp(state.cycleBeginTime.value, 1).toString();
|
||||
@ -61,27 +62,27 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
// var isCoerced = state.isStressFingerprint.value == false ? "1" : "2"; // 1:非胁迫指纹 2:胁迫指纹
|
||||
|
||||
// 指纹
|
||||
Get.toNamed(Routers.addFingerprintPage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"endDate": endDate,
|
||||
"addType": "1",
|
||||
"fingerprintName": state.nameController.text,
|
||||
"fingerprintNumber": "123456",
|
||||
"fingerprintType": fingerprintType.toString(),
|
||||
"isCoerced": state.isStressFingerprint.value == false ? "1" : "2", // 1:非胁迫指纹 2:胁迫指纹
|
||||
"startDate": startDate,
|
||||
"weekDay": state.weekdaysList.value,
|
||||
"fromType": state.fromType.value,
|
||||
"isAdministrator": state.isAdministrator.value == false ? "1" : "2", // 1:不是管理员 2:是管理员
|
||||
"effectiveTime": startTime,
|
||||
"failureTime": endTime,
|
||||
"selectType": state.selectType.value,
|
||||
Get.toNamed(Routers.addFingerprintPage, arguments: <String, Object>{
|
||||
'lockId': state.lockId.value,
|
||||
'endDate': endDate,
|
||||
'addType': '1',
|
||||
'fingerprintName': state.nameController.text,
|
||||
'fingerprintNumber': '123456',
|
||||
'fingerprintType': fingerprintType.toString(),
|
||||
'isCoerced': state.isStressFingerprint.value == false ? '1' : '2', // 1:非胁迫指纹 2:胁迫指纹
|
||||
'startDate': startDate,
|
||||
'weekDay': state.weekdaysList.value,
|
||||
'fromType': state.fromType.value,
|
||||
'isAdministrator': state.isAdministrator.value == false ? '1' : '2', // 1:不是管理员 2:是管理员
|
||||
'effectiveTime': startTime,
|
||||
'failureTime': endTime,
|
||||
'selectType': state.selectType.value,
|
||||
});
|
||||
}
|
||||
|
||||
// 校验指纹名字是否重复
|
||||
void checkFingerprintNameDuplicated(String fingerprintName) async{
|
||||
var entity = await ApiRepository.to.checkFingerprintNameDuplicatedData(
|
||||
Future<void> checkFingerprintNameDuplicated(String fingerprintName) async{
|
||||
final LoginEntity entity = await ApiRepository.to.checkFingerprintNameDuplicatedData(
|
||||
lockId: state.lockId.value.toString(),
|
||||
fingerprintName: fingerprintName,
|
||||
);
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintType_state.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||
@ -27,12 +28,11 @@ class AddFingerprintTypePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with SingleTickerProviderStateMixin{
|
||||
final logic = Get.put(AddFingerprintTypeLogic());
|
||||
final state = Get.find<AddFingerprintTypeLogic>().state;
|
||||
final AddFingerprintTypeLogic logic = Get.put(AddFingerprintTypeLogic());
|
||||
final AddFingerprintState state = Get.find<AddFingerprintTypeLogic>().state;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
|
||||
state.tabController = TabController(
|
||||
@ -60,7 +60,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
_tabBar(),
|
||||
_pageWidget(),
|
||||
],
|
||||
@ -76,7 +76,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
// return sendElectronicKeySucceed();
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
perpetualKeyWidget(
|
||||
TranslationLoader.lanKeys!.name!.tr,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
@ -91,7 +91,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
// 限时
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
perpetualKeyWidget(
|
||||
TranslationLoader.lanKeys!.name!.tr,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
@ -107,7 +107,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
// 循环
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
perpetualKeyWidget(
|
||||
TranslationLoader.lanKeys!.name!.tr,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
@ -128,10 +128,10 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
Widget perpetualKeyWidget(
|
||||
String titleStr, String rightTitle, TextEditingController controller) {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
CommonItem(
|
||||
leftTitel: titleStr,
|
||||
rightTitle: "",
|
||||
rightTitle: '',
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: getTFWidget(rightTitle)),
|
||||
Container(height: 10.h),
|
||||
@ -142,7 +142,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
// 限时顶部选择日期
|
||||
Widget keyTimeLimitWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||
rightTitle: state.timeLimitBeginTime.value,
|
||||
@ -152,7 +152,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
PDuration selectDate =
|
||||
PDuration.parse(DateTime.tryParse(state.timeLimitBeginTime.value));
|
||||
Pickers.showDatePicker(context,selectDate:selectDate, mode: DateMode.YMDHM,
|
||||
onConfirm: (p) {
|
||||
onConfirm: (PDuration p) {
|
||||
state.timeLimitBeginTime.value = DateTool().getYMDHNDateString(p, 1);
|
||||
});
|
||||
})),
|
||||
@ -164,7 +164,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
PDuration selectDate =
|
||||
PDuration.parse(DateTime.tryParse(state.timeLimitEndTime.value));
|
||||
Pickers.showDatePicker(context,selectDate:selectDate, mode: DateMode.YMDHM,
|
||||
onConfirm: (p) {
|
||||
onConfirm: (PDuration p) {
|
||||
state.timeLimitEndTime.value = DateTool().getYMDHNDateString(p, 1);
|
||||
});
|
||||
})),
|
||||
@ -176,14 +176,14 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
// 循环顶部选择日期
|
||||
Widget keyCyclicDate() {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||
rightTitle:"${state.cycleBeginTime.value}\n${state.cycleEndTime.value}",
|
||||
rightTitle:'${state.cycleBeginTime.value}\n${state.cycleEndTime.value}',
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
'validityValue': state.weekdaysList.value,
|
||||
'starDate': state.cycleBeginTime.value,
|
||||
'endDate': state.cycleEndTime.value,
|
||||
@ -199,14 +199,14 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
}
|
||||
})),
|
||||
Obx(() => Visibility(
|
||||
visible: state.weekdaysList.isNotEmpty ? true : false,
|
||||
visible: state.weekdaysList.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效日".tr,
|
||||
rightTitle: state.weekdaysList.value.join(",").toString(),
|
||||
leftTitel: '有效日'.tr,
|
||||
rightTitle: state.weekdaysList.value.join(',').toString(),
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
'validityValue': state.weekdaysList.value,
|
||||
'starDate': state.cycleBeginTime.value,
|
||||
'endDate': state.cycleEndTime.value,
|
||||
@ -224,11 +224,11 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
Obx(() => Visibility(
|
||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效时间".tr,
|
||||
rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
||||
leftTitel: '有效时间'.tr,
|
||||
rightTitle: '${state.effectiveDateTime.value}-${state.failureDateTime.value}',
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: <String, Object>{
|
||||
'validityValue': state.weekdaysList.value,
|
||||
'starDate': state.cycleBeginTime.value,
|
||||
'endDate': state.cycleEndTime.value,
|
||||
@ -249,14 +249,12 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
|
||||
Widget keyBottomWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => Visibility(
|
||||
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
|
||||
? true
|
||||
: false,
|
||||
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1,
|
||||
child: CommonItem(
|
||||
leftTitel: "是否为管理员".tr,
|
||||
rightTitle: "",
|
||||
leftTitel: '是否为管理员'.tr,
|
||||
rightTitle: '',
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
@ -264,7 +262,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
SizedBox(height: 10.h),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.stressFingerprint!.tr,
|
||||
rightTitle: "",
|
||||
rightTitle: '',
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
@ -282,16 +280,16 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
onClick: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
if (state.nameController.text.isEmpty) {
|
||||
logic.showToast("请输入姓名".tr);
|
||||
logic.showToast('请输入姓名'.tr);
|
||||
return;
|
||||
}
|
||||
logic.checkFingerprintNameDuplicated(state.nameController.text);
|
||||
} else {
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式".tr);
|
||||
logic.showToast('演示模式'.tr);
|
||||
}
|
||||
}),
|
||||
],
|
||||
@ -378,7 +376,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: TextField(
|
||||
//输入框一行
|
||||
@ -423,7 +421,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isStressFingerprint.value,
|
||||
onChanged: (value) {
|
||||
onChanged: (bool value) {
|
||||
state.isStressFingerprint.value = value;
|
||||
},
|
||||
);
|
||||
@ -436,27 +434,27 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
onChanged: (bool value) {
|
||||
state.isAdministrator.value = value;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
final List<ItemView> _itemTabs = <ItemView>[
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: '0'),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: '1'),
|
||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, selectType: '2'),
|
||||
];
|
||||
|
||||
final List<ItemView> _fromCheckInTypeItemTabs = <ItemView>[
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: '0'),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: '1'),
|
||||
];
|
||||
|
||||
TabBar _tabBar() {
|
||||
return TabBar(
|
||||
controller: state.tabController,
|
||||
onTap: (index) {
|
||||
onTap: (int index) {
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
},
|
||||
tabs: state.fromType.value == 1 ? _itemTabs.map((ItemView item) => _tab(item)).toList() : _fromCheckInTypeItemTabs.map((ItemView item) => _tab(item)).toList(),
|
||||
|
||||
@ -1,38 +1,39 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../tools/dateTool.dart';
|
||||
|
||||
class AddFingerprintState {
|
||||
final lockId = 0.obs;
|
||||
final selectType = "0".obs; // 0永久 1显示 2循环
|
||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final isStressFingerprint = false.obs;
|
||||
final isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
var timeLimitBeginTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时开始时间
|
||||
var timeLimitEndTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时结束时间
|
||||
var cycleBeginTime = "".obs; // 循环开始时间
|
||||
var cycleEndTime = "".obs; // 循环结束时间
|
||||
var effectiveDateTime = "".obs; // 生效时间
|
||||
var failureDateTime = "".obs; // 失效时间
|
||||
var weekdaysList = [].obs;
|
||||
var fromTypeTwoStaffName = "".obs; // 从添加员工进入 传入员工名字
|
||||
|
||||
final TextEditingController nameController = TextEditingController();
|
||||
late TabController tabController;
|
||||
AddFingerprintState() {
|
||||
Map map = Get.arguments;
|
||||
lockId.value = map["lockId"];
|
||||
fromType.value = map["fromType"];
|
||||
lockId.value = map['lockId'];
|
||||
fromType.value = map['fromType'];
|
||||
// 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
if (fromType.value == 2) {
|
||||
fromTypeTwoStaffName.value =
|
||||
map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字
|
||||
map['fromTypeTwoStaffName']; // 从添加员工进入 传入员工名字
|
||||
}
|
||||
}
|
||||
final RxInt lockId = 0.obs;
|
||||
final RxString selectType = '0'.obs; // 0永久 1显示 2循环
|
||||
final RxInt fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final RxBool isStressFingerprint = false.obs;
|
||||
final RxBool isAdministrator = false.obs; // 是否为管理员
|
||||
|
||||
RxString timeLimitBeginTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时开始时间
|
||||
RxString timeLimitEndTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
.obs; // 限时结束时间
|
||||
RxString cycleBeginTime = ''.obs; // 循环开始时间
|
||||
RxString cycleEndTime = ''.obs; // 循环结束时间
|
||||
RxString effectiveDateTime = ''.obs; // 生效时间
|
||||
RxString failureDateTime = ''.obs; // 失效时间
|
||||
RxList weekdaysList = [].obs;
|
||||
RxString fromTypeTwoStaffName = ''.obs; // 从添加员工进入 传入员工名字
|
||||
|
||||
final TextEditingController nameController = TextEditingController();
|
||||
late TabController tabController;
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_logic.dart';
|
||||
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_state.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
@ -21,8 +22,8 @@ class RecipientInformationPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
final logic = Get.put(RecipientInformationLogic());
|
||||
final state = Get.find<RecipientInformationLogic>().state;
|
||||
final RecipientInformationLogic logic = Get.put(RecipientInformationLogic());
|
||||
final RecipientInformationState state = Get.find<RecipientInformationLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -35,7 +36,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(height: 150.h, child: _buildMainUI()),
|
||||
SizedBox(height: 10.h),
|
||||
_buildAccoutRow(),
|
||||
@ -43,7 +44,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
_buildNextBtn(context),
|
||||
SizedBox(height: 64.h),
|
||||
Visibility(
|
||||
visible: state.isFromType.value == 1 ? true : false,
|
||||
visible: state.isFromType.value == 1,
|
||||
child: _buildRemoveBadLockBtn()),
|
||||
SizedBox(
|
||||
height: 64.h,
|
||||
@ -55,12 +56,12 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
|
||||
Widget _buildMainUI() {
|
||||
return Obx(() => Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
_electronicKeyItem(
|
||||
state.type.value == 1
|
||||
? 'images/select_circle.png'
|
||||
: 'images/normal_circle.png',
|
||||
"个人用户", () {
|
||||
'个人用户', () {
|
||||
setState(() {
|
||||
state.type.value = 1;
|
||||
});
|
||||
@ -69,7 +70,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
state.type.value == 2
|
||||
? 'images/select_circle.png'
|
||||
: 'images/normal_circle.png',
|
||||
"星寓", () {
|
||||
'星寓', () {
|
||||
setState(() {
|
||||
state.type.value = 2;
|
||||
});
|
||||
@ -88,7 +89,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 40.w,
|
||||
),
|
||||
@ -117,9 +118,9 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
// height: 60.h,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 40.w,
|
||||
),
|
||||
@ -131,11 +132,11 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
controller: state.numberController,
|
||||
textAlign: TextAlign.right,
|
||||
keyboardType: TextInputType.text,
|
||||
onChanged: (value) {},
|
||||
onChanged: (String value) {},
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText:
|
||||
state.type.value == 1 ? "请输入手机号或email" : "请输入星寓管理员的账号",
|
||||
state.type.value == 1 ? '请输入手机号或email' : '请输入星寓管理员的账号',
|
||||
hintStyle: TextStyle(
|
||||
color: AppColors.placeholderTextColor,
|
||||
fontSize: ScreenUtil().setSp(22),
|
||||
@ -152,7 +153,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
if (currentContact.phoneNumbers!.isNotEmpty) {
|
||||
state.numberController.text = currentContact
|
||||
.phoneNumbers![0]
|
||||
.replaceAll(RegExp(r"\s+\b|\b\s"), "");
|
||||
.replaceAll(RegExp(r'\s+\b|\b\s'), '');
|
||||
}
|
||||
},
|
||||
child: Image.asset(
|
||||
@ -174,7 +175,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||
rightTitle: "",
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
isHaveDirection: true,
|
||||
@ -185,7 +186,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
Object? result = await Navigator.pushNamed(
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
@ -217,17 +218,17 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
btnName: '下一步',
|
||||
onClick: () {
|
||||
if (state.numberController.text.isEmpty) {
|
||||
logic.showToast("请输入手机号或email");
|
||||
logic.showToast('请输入手机号或email');
|
||||
return;
|
||||
}
|
||||
if (state.isFromType.value == 1) {
|
||||
// 转移智能锁
|
||||
if (state.type.value == 1) {
|
||||
logic.transferLockConfirmInfoData((v) {
|
||||
logic.transferLockConfirmInfoData((RecipientInformationData v) {
|
||||
showCupertinoAlertDialog(context, v);
|
||||
});
|
||||
} else {
|
||||
logic.showToast("暂不支持跨平台转移,敬请期待");
|
||||
logic.showToast('暂不支持跨平台转移,敬请期待');
|
||||
// Get.toNamed(Routers.selectBranchPage, arguments: {
|
||||
// "idList": state.idList.value,
|
||||
// "countryCode": state.countryCode.value,
|
||||
@ -238,11 +239,11 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
} else {
|
||||
// 转移网关
|
||||
if (state.type.value == 1) {
|
||||
logic.transferGateWayConfirmInfoData((v) {
|
||||
logic.transferGateWayConfirmInfoData((RecipientInformationData v) {
|
||||
showCupertinoAlertDialog(context, v);
|
||||
});
|
||||
} else {
|
||||
logic.showToast("暂不支持跨平台转移,敬请期待");
|
||||
logic.showToast('暂不支持跨平台转移,敬请期待');
|
||||
|
||||
// Get.toNamed(Routers.selectBranchPage, arguments: {
|
||||
// "idList": state.idList.value,
|
||||
@ -257,12 +258,10 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
|
||||
Widget _buildRemoveBadLockBtn() {
|
||||
return Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
const Expanded(child: SizedBox()),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
logic.showDeletAlertDialog();
|
||||
},
|
||||
onPressed: logic.showDeletAlertDialog,
|
||||
child: Text(
|
||||
'移除坏锁',
|
||||
style: TextStyle(
|
||||
@ -298,9 +297,9 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
height: 400.h,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(height: 20.h),
|
||||
Text("转移确认", style: TextStyle(fontSize: 24.sp)),
|
||||
Text('转移确认', style: TextStyle(fontSize: 24.sp)),
|
||||
SizedBox(height: 20.h),
|
||||
Image.asset('images/icon_lockGroup_item.png',
|
||||
width: 70.h, height: 70.h, fit: BoxFit.fill),
|
||||
@ -318,7 +317,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
width: 80.w,
|
||||
color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(state.type.value == 1 ? "个人用户" : "星寓",
|
||||
child: Text(state.type.value == 1 ? '个人用户' : '星寓',
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp, color: Colors.white))),
|
||||
),
|
||||
@ -329,19 +328,16 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
Text(recipientInformationData.userid!,
|
||||
style: TextStyle(fontSize: 22.sp)),
|
||||
SizedBox(height: 8.h),
|
||||
Text("本次共转移${state.idList.value.length}把智能锁",
|
||||
Text('本次共转移${state.idList.value.length}把智能锁',
|
||||
style: TextStyle(fontSize: 20.sp)),
|
||||
SizedBox(height: 20.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
onPressed: Get.back,
|
||||
style: ElevatedButton.styleFrom(
|
||||
onPrimary: AppColors.appBarIconColor,
|
||||
backgroundColor: Colors.grey,
|
||||
foregroundColor: AppColors.appBarIconColor, backgroundColor: Colors.grey,
|
||||
minimumSize: Size(110.w, 45.h),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
shape: const RoundedRectangleBorder(
|
||||
@ -362,8 +358,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
onPrimary: AppColors.appBarIconColor,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
foregroundColor: AppColors.appBarIconColor, backgroundColor: AppColors.mainColor,
|
||||
minimumSize: Size(110.w, 45.h),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
shape: const RoundedRectangleBorder(
|
||||
|
||||
@ -189,12 +189,9 @@ class _SelectBranchPageState extends State<SelectBranchPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
onPressed: Get.back,
|
||||
style: ElevatedButton.styleFrom(
|
||||
onPrimary: AppColors.appBarIconColor,
|
||||
backgroundColor: Colors.grey,
|
||||
foregroundColor: AppColors.appBarIconColor, backgroundColor: Colors.grey,
|
||||
minimumSize: Size(110.w, 45.h),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
shape: const RoundedRectangleBorder(
|
||||
@ -204,13 +201,9 @@ class _SelectBranchPageState extends State<SelectBranchPage> {
|
||||
child: Text('取消'.tr, style: TextStyle(fontSize: 22.sp)),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
// logic.transferLockInfoData();
|
||||
},
|
||||
onPressed: Get.back,
|
||||
style: ElevatedButton.styleFrom(
|
||||
onPrimary: AppColors.appBarIconColor,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
foregroundColor: AppColors.appBarIconColor, backgroundColor: AppColors.mainColor,
|
||||
minimumSize: Size(110.w, 45.h),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
shape: const RoundedRectangleBorder(
|
||||
|
||||
@ -165,7 +165,7 @@ dependencies:
|
||||
|
||||
#网络图片缓存
|
||||
cached_network_image: ^3.2.0
|
||||
webview_flutter: 4.5.0
|
||||
webview_flutter: ^4.4.2
|
||||
|
||||
jpush_flutter: ^2.5.1
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user