fix: 合并bugly分支到当前分支
This commit is contained in:
parent
202c97e0d3
commit
debb1bfd40
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
@ -52,9 +51,9 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
deviceInfo: state.deviceInfoMap);
|
deviceInfo: state.deviceInfoMap);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('login_result', {
|
UmengCommonSdk.onEvent('login_result', {
|
||||||
'account':state.emailOrPhone.value,
|
'account': state.emailOrPhone.value,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'login_res':'成功',
|
'login_res': '成功',
|
||||||
});
|
});
|
||||||
|
|
||||||
Storage.saveLoginData(entity.data);
|
Storage.saveLoginData(entity.data);
|
||||||
@ -65,11 +64,11 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||||
}else{
|
} else {
|
||||||
UmengCommonSdk.onEvent('login_result', {
|
UmengCommonSdk.onEvent('login_result', {
|
||||||
'account':state.emailOrPhone.value,
|
'account': state.emailOrPhone.value,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'login_res':'${entity.errorCode}--${entity.errorMsg}',
|
'login_res': '${entity.errorCode}--${entity.errorMsg}',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import '../../../tools/storage.dart';
|
|||||||
import '../lockOperatingRecord/keyOperationRecord_entity.dart';
|
import '../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
class DoorLockLogLogic extends BaseGetXController {
|
class DoorLockLogLogic extends BaseGetXController {
|
||||||
DoorLockLogState state = DoorLockLogState();
|
final DoorLockLogState state = DoorLockLogState();
|
||||||
|
|
||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
@ -47,8 +47,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
message: '查询锁记录结果,解析数据',
|
message: '查询锁记录结果,解析数据',
|
||||||
detail: '查询锁记录结果,解析数据:${reply.data}',
|
detail: '查询锁记录结果,解析数据:${reply.data}',
|
||||||
eventStr: '查询锁记录事件结果',
|
eventStr: '查询锁记录事件结果',
|
||||||
upload: true
|
upload: true);
|
||||||
);
|
|
||||||
|
|
||||||
state.isLockReceiveResponse = true;
|
state.isLockReceiveResponse = true;
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
@ -121,13 +120,15 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 查询事件记录(时间查询)
|
// 查询事件记录(时间查询)
|
||||||
Future<void> senderReferEventRecordTime() async {
|
Future<void> senderReferEventRecordTime() async {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
final String command = SenderReferEventRecordTimeCommand(
|
final String command = SenderReferEventRecordTimeCommand(
|
||||||
@ -144,37 +145,45 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
).toString();
|
).toString();
|
||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(isShowBlueConnetctToast:true, action: () async {
|
showBlueConnetctToastTimer(
|
||||||
cancelBlueConnetctToastTimer();
|
isShowBlueConnetctToast: true,
|
||||||
|
action: () async {
|
||||||
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||||
'lockName':state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'open_lock_result':'超时',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
});
|
'open_lock_result': '超时',
|
||||||
|
});
|
||||||
|
|
||||||
BuglyTool.uploadException(
|
BuglyTool.uploadException(
|
||||||
message: '查询锁记录超时-查询锁记录失败',
|
message: '查询锁记录超时-查询锁记录失败',
|
||||||
detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
detail:
|
||||||
eventStr: '查询锁记录事件超时',
|
'添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
||||||
upload: true
|
eventStr: '查询锁记录事件超时',
|
||||||
);
|
upload: true);
|
||||||
if(state.isLockReceiveResponse == false){
|
if (state.isLockReceiveResponse == false) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionStateState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
|
(BluetoothConnectionState connectionStateState) async {
|
||||||
if (connectionStateState == BluetoothConnectionState.connected) {
|
if (connectionStateState == BluetoothConnectionState.connected) {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
|
final List<int> getPublicKeyList =
|
||||||
|
changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
IoSenderManage.senderReferEventRecordTimeCommand(
|
IoSenderManage.senderReferEventRecordTimeCommand(
|
||||||
keyID: BlueManage().connectDeviceName,
|
keyID: BlueManage().connectDeviceName,
|
||||||
@ -188,7 +197,8 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
publicKey: getPublicKeyList,
|
publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList,
|
privateKey: getPrivateKeyList,
|
||||||
);
|
);
|
||||||
} else if (connectionStateState == BluetoothConnectionState.disconnected) {
|
} else if (connectionStateState ==
|
||||||
|
BluetoothConnectionState.disconnected) {
|
||||||
if (state.ifCurrentScreen.value == true) {
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
@ -196,18 +206,19 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||||
'lockName':state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'open_lock_result':'断开连接',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'open_lock_result': '断开连接',
|
||||||
});
|
});
|
||||||
|
|
||||||
BuglyTool.uploadException(
|
BuglyTool.uploadException(
|
||||||
message: '查询锁记录超时-查询锁记录失败',
|
message: '查询锁记录超时-查询锁记录失败',
|
||||||
detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
detail:
|
||||||
|
'添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
||||||
eventStr: '查询锁记录事件断开连接',
|
eventStr: '查询锁记录事件断开连接',
|
||||||
upload: true
|
upload: true);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -238,7 +249,9 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
/// 刷新门锁日志列表
|
/// 刷新门锁日志列表
|
||||||
StreamSubscription? _getDoorLockLogListRefreshUIEvent;
|
StreamSubscription? _getDoorLockLogListRefreshUIEvent;
|
||||||
void _getDoorLockLogListRefreshUIAction() {
|
void _getDoorLockLogListRefreshUIAction() {
|
||||||
_getDoorLockLogListRefreshUIEvent = eventBus.on<DoorLockLogListRefreshUI>().listen((DoorLockLogListRefreshUI event) {
|
_getDoorLockLogListRefreshUIEvent = eventBus
|
||||||
|
.on<DoorLockLogListRefreshUI>()
|
||||||
|
.listen((DoorLockLogListRefreshUI event) {
|
||||||
state.currentSelectDate.value = event.getDoorLockLogTime;
|
state.currentSelectDate.value = event.getDoorLockLogTime;
|
||||||
|
|
||||||
// 设置startDate为当天的0点
|
// 设置startDate为当天的0点
|
||||||
@ -281,7 +294,9 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
if (list.isEmpty) {
|
if (list.isEmpty) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordUploadData(lockId: state.keyInfos.value.lockId.toString(), records: list);
|
final KeyOperationRecordEntity entity = await ApiRepository.to
|
||||||
|
.lockRecordUploadData(
|
||||||
|
lockId: state.keyInfos.value.lockId.toString(), records: list);
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
if (state.ifHaveNext == true) {
|
if (state.ifHaveNext == true) {
|
||||||
@ -289,20 +304,22 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
getLockRecordLastUploadDataTime();
|
getLockRecordLastUploadDataTime();
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||||
'lockName':state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'open_lock_result':'成功',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'open_lock_result': '成功',
|
||||||
});
|
});
|
||||||
mockNetworkDataRequest(isRefresh: true);
|
mockNetworkDataRequest(isRefresh: true);
|
||||||
}
|
}
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
}else{
|
} else {
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||||
'lockName':state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'open_lock_result':'上传数据接口失败',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'open_lock_result': '上传数据接口失败',
|
||||||
});
|
});
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
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';
|
||||||
@ -53,7 +52,9 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
ShowTipView().showSureAlertDialog(
|
ShowTipView().showSureAlertDialog(
|
||||||
'1.锁没有联网,密码、IC卡、指纹等开门记录无法实时上传,可以点击右上角按钮,然后读取记录。'.tr +'\n' + '2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录'.tr,
|
'1.锁没有联网,密码、IC卡、指纹等开门记录无法实时上传,可以点击右上角按钮,然后读取记录。'.tr +
|
||||||
|
'\n' +
|
||||||
|
'2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录'.tr,
|
||||||
tipTitle: '看不到操作记录,可能原因有'.tr,
|
tipTitle: '看不到操作记录,可能原因有'.tr,
|
||||||
sureStr: '我知道了'.tr);
|
sureStr: '我知道了'.tr);
|
||||||
},
|
},
|
||||||
@ -121,25 +122,13 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _onMenuItemSelected(String value) {
|
void _onMenuItemSelected(String value) {
|
||||||
if(value == '读取记录'.tr){
|
if (value == '读取记录'.tr) {
|
||||||
logic.mockNetworkDataRequest(isRefresh: true);
|
logic.mockNetworkDataRequest(isRefresh: true);
|
||||||
}else if(value == '清空记录'.tr){
|
} else if (value == '清空记录'.tr) {
|
||||||
ShowCupertinoAlertView().showClearOperationRecordAlert(
|
ShowCupertinoAlertView().showClearOperationRecordAlert(clearClick: () {
|
||||||
clearClick: () {
|
logic.clearOperationRecordRequest();
|
||||||
switch (value) {
|
});
|
||||||
case '读取记录':
|
} else if (value == '导出记录'.tr) {
|
||||||
{
|
|
||||||
state.isLockReceiveResponse = false;
|
|
||||||
logic.getLockRecordLastUploadDataTime();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case '清空记录':
|
|
||||||
{
|
|
||||||
ShowCupertinoAlertView().showClearOperationRecordAlert(
|
|
||||||
clearClick: () {
|
|
||||||
logic.clearOperationRecordRequest();
|
|
||||||
});
|
|
||||||
}else if(value == '导出记录'.tr){
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@ -152,38 +141,38 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// switch (value) {
|
|
||||||
// case "读取记录".tr:
|
|
||||||
// {
|
|
||||||
// logic.mockNetworkDataRequest(isRefresh: true);
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// case '清空记录'.tr:
|
|
||||||
// {
|
|
||||||
// ShowCupertinoAlertView().showClearOperationRecordAlert(
|
|
||||||
// clearClick: () {
|
|
||||||
// logic.clearOperationRecordRequest();
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// case '导出记录':
|
|
||||||
// {
|
|
||||||
// showDialog(
|
|
||||||
// context: context,
|
|
||||||
// builder: (BuildContext context) {
|
|
||||||
// return ExportRecordDialog(
|
|
||||||
// onExport: (String filePath) {
|
|
||||||
// Get.toNamed(Routers.exportSuccessPage,
|
|
||||||
// arguments: <String, String>{'filePath': filePath});
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
// switch (value) {
|
||||||
|
// case "读取记录".tr:
|
||||||
|
// {
|
||||||
|
// logic.mockNetworkDataRequest(isRefresh: true);
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case '清空记录'.tr:
|
||||||
|
// {
|
||||||
|
// ShowCupertinoAlertView().showClearOperationRecordAlert(
|
||||||
|
// clearClick: () {
|
||||||
|
// logic.clearOperationRecordRequest();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case '导出记录':
|
||||||
|
// {
|
||||||
|
// showDialog(
|
||||||
|
// context: context,
|
||||||
|
// builder: (BuildContext context) {
|
||||||
|
// return ExportRecordDialog(
|
||||||
|
// onExport: (String filePath) {
|
||||||
|
// Get.toNamed(Routers.exportSuccessPage,
|
||||||
|
// arguments: <String, String>{'filePath': filePath});
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
//顶部日历小部件
|
//顶部日历小部件
|
||||||
Widget topAdvancedCalendarWidget() {
|
Widget topAdvancedCalendarWidget() {
|
||||||
|
|||||||
@ -69,13 +69,14 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
detail: '开锁结果,解析数据 _replyOpenLock:${reply.data}',
|
detail: '开锁结果,解析数据 _replyOpenLock:${reply.data}',
|
||||||
upload: true);
|
upload: true);
|
||||||
|
|
||||||
if(status != 6){
|
if (status != 6) {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('open_lock', {
|
UmengCommonSdk.onEvent('open_lock', {
|
||||||
'lock_name':state.keyInfos.value.lockName!,
|
'lock_name': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'open_lock_result':'${reply.data}',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'open_lock_result': '${reply.data}',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,10 +379,11 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
action: () async {
|
action: () async {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('open_lock', {
|
UmengCommonSdk.onEvent('open_lock', {
|
||||||
'lock_name':state.keyInfos.value.lockName!,
|
'lock_name': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'open_lock_result':'超时',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'open_lock_result': '超时',
|
||||||
});
|
});
|
||||||
|
|
||||||
resetOpenDoorState();
|
resetOpenDoorState();
|
||||||
@ -419,14 +421,13 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
message: '蓝牙连接失败-开锁失败',
|
message: '蓝牙连接失败-开锁失败',
|
||||||
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
|
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
|
||||||
upload: true);
|
upload: true);
|
||||||
upload: true
|
|
||||||
);
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('open_lock', {
|
UmengCommonSdk.onEvent('open_lock', {
|
||||||
'lock_name':state.keyInfos.value.lockName!,
|
'lock_name': state.keyInfos.value.lockName!,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'open_lock_result':'断开连接',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'open_lock_result': '断开连接',
|
||||||
});
|
});
|
||||||
|
|
||||||
if (state.ifCurrentScreen.value == true) {
|
if (state.ifCurrentScreen.value == true) {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
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';
|
||||||
@ -19,17 +18,20 @@ class LockOperatingRecordPage extends StatefulWidget {
|
|||||||
const LockOperatingRecordPage({Key? key}) : super(key: key);
|
const LockOperatingRecordPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<LockOperatingRecordPage> createState() => _LockOperatingRecordPageState();
|
State<LockOperatingRecordPage> createState() =>
|
||||||
|
_LockOperatingRecordPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with RouteAware{
|
class _LockOperatingRecordPageState extends State<LockOperatingRecordPage>
|
||||||
|
with RouteAware {
|
||||||
final LockOperatingRecordLogic logic = Get.put(LockOperatingRecordLogic());
|
final LockOperatingRecordLogic logic = Get.put(LockOperatingRecordLogic());
|
||||||
final LockOperatingRecordState state = Get.find<LockOperatingRecordLogic>().state;
|
final LockOperatingRecordState state =
|
||||||
|
Get.find<LockOperatingRecordLogic>().state;
|
||||||
|
|
||||||
Future<void> getHttpData() async {
|
Future<void> getHttpData() async {
|
||||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
logic.mockNetworkDataRequest().then((KeyOperationRecordEntity value){
|
logic.mockNetworkDataRequest().then((KeyOperationRecordEntity value) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
@ -49,7 +51,9 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: state.recordName.value.isNotEmpty? state.recordName.value : '操作记录'.tr,
|
barTitle: state.recordName.value.isNotEmpty
|
||||||
|
? state.recordName.value
|
||||||
|
: '操作记录'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
// actionsList: [
|
// actionsList: [
|
||||||
@ -75,11 +79,11 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
// ],
|
// ],
|
||||||
),
|
),
|
||||||
body: EasyRefreshTool(
|
body: EasyRefreshTool(
|
||||||
onRefresh: (){
|
onRefresh: () {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
getHttpData();
|
getHttpData();
|
||||||
},
|
},
|
||||||
onLoad: (){
|
onLoad: () {
|
||||||
getHttpData();
|
getHttpData();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -138,7 +142,10 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight));
|
: NoData(
|
||||||
|
noDataHeight: 1.sh -
|
||||||
|
ScreenUtil().statusBarHeight -
|
||||||
|
ScreenUtil().bottomBarHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
String getTypeIcon(int type) {
|
String getTypeIcon(int type) {
|
||||||
@ -166,7 +173,8 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _operatingOneRecordItem(String userAvatarStr, String userNameStr, String unlockDescStr, Function() action) {
|
Widget _operatingOneRecordItem(String userAvatarStr, String userNameStr,
|
||||||
|
String unlockDescStr, Function() action) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: action,
|
onTap: action,
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -181,23 +189,23 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(Icons.access_time, size: 35.w),
|
Icon(Icons.access_time, size: 35.w),
|
||||||
SizedBox(width: 10.w,),
|
SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
unlockDescStr,
|
unlockDescStr,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.sp,
|
fontSize: 24.sp, color: AppColors.darkGrayTextColor),
|
||||||
color: AppColors.darkGrayTextColor),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 10.h),
|
SizedBox(width: 10.h),
|
||||||
Expanded(
|
Expanded(
|
||||||
child:Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(bottom: 3.w),
|
margin: EdgeInsets.only(bottom: 3.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(userNameStr,
|
||||||
userNameStr,
|
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@ -298,6 +306,7 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
|
|
||||||
/// 路由订阅
|
/// 路由订阅
|
||||||
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
||||||
}
|
}
|
||||||
@ -344,5 +353,4 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
|
|||||||
}
|
}
|
||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
@ -126,11 +125,15 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
final List<String>? publicKey =
|
||||||
final List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
await Storage.getStringList(saveBluePublicKey);
|
||||||
|
final List<int> publicKeyDataList =
|
||||||
|
changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
@ -292,11 +295,12 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
action: () async {
|
action: () async {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'delet_type':'lock',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_lock_result':'删除锁超时',
|
'delet_type': 'lock',
|
||||||
|
'delet_lock_result': '删除锁超时',
|
||||||
});
|
});
|
||||||
|
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
@ -329,11 +333,12 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'delet_type':'lock',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_lock_result':'删除锁断开',
|
'delet_type': 'lock',
|
||||||
|
'delet_lock_result': '删除锁断开',
|
||||||
});
|
});
|
||||||
|
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
@ -373,7 +378,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 设置支持功能(带参数)
|
// 设置支持功能(带参数)
|
||||||
Future<void> sendBurglarAlarm(int type) async {
|
Future<void> sendBurglarAlarm(int type) async {
|
||||||
if(state.sureBtnState.value == 1){
|
if (state.sureBtnState.value == 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.sureBtnState.value = 1;
|
state.sureBtnState.value = 1;
|
||||||
@ -553,10 +558,12 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
void deleyLockLogicOfRoles() {
|
void deleyLockLogicOfRoles() {
|
||||||
if (state.lockBasicInfo.value.isLockOwner == 1) {
|
if (state.lockBasicInfo.value.isLockOwner == 1) {
|
||||||
// 超级管理员必须通过连接蓝牙删除q
|
// 超级管理员必须通过连接蓝牙删除q
|
||||||
state.showTipView.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
|
state.showTipView
|
||||||
|
.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
|
||||||
// 删除锁
|
// 删除锁
|
||||||
state.showTipView.resetGetController();
|
state.showTipView.resetGetController();
|
||||||
state.showTipView.showTFViewAlertDialog(state.passwordTF, '请输入登录密码'.tr, '请输入登录密码'.tr, checkLoginPassword);
|
state.showTipView.showTFViewAlertDialog(
|
||||||
|
state.passwordTF, '请输入登录密码'.tr, '请输入登录密码'.tr, checkLoginPassword);
|
||||||
});
|
});
|
||||||
} else if (state.lockBasicInfo.value.keyRight == 1) {
|
} else if (state.lockBasicInfo.value.keyRight == 1) {
|
||||||
// 授权管理员弹框提示
|
// 授权管理员弹框提示
|
||||||
@ -591,11 +598,12 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'delet_type':'lock',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_lock_result':'成功',
|
'delet_type': 'lock',
|
||||||
|
'delet_lock_result': '成功',
|
||||||
});
|
});
|
||||||
|
|
||||||
BlueManage().connectDeviceMacAddress = '';
|
BlueManage().connectDeviceMacAddress = '';
|
||||||
@ -607,13 +615,14 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'delet_type':'lock',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_lock_result':'${entity.errorCode}--${entity.errorMsg}',
|
'delet_type': 'lock',
|
||||||
|
'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -628,11 +637,12 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'delet_type':'key',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_lock_result':'成功',
|
'delet_type': 'key',
|
||||||
|
'delet_lock_result': '成功',
|
||||||
});
|
});
|
||||||
|
|
||||||
BlueManage().connectDeviceMacAddress = '';
|
BlueManage().connectDeviceMacAddress = '';
|
||||||
@ -644,13 +654,14 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
UmengCommonSdk.onEvent('delet_lock', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'delet_type':'key',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'delet_lock_result':'${entity.errorCode}--${entity.errorMsg}',
|
'delet_type': 'key',
|
||||||
|
'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,10 +135,11 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('logout', {
|
UmengCommonSdk.onEvent('logout', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'logout_result':'成功',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'logout_result': '成功',
|
||||||
});
|
});
|
||||||
|
|
||||||
UdpHelp().closeUDP();
|
UdpHelp().closeUDP();
|
||||||
@ -150,12 +151,13 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
BlueManage().disconnect();
|
BlueManage().disconnect();
|
||||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
|
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
|
||||||
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
|
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
|
||||||
}else{
|
} else {
|
||||||
UmengCommonSdk.onEvent('logout', {
|
UmengCommonSdk.onEvent('logout', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'logout_result':'${entity.errorCode}--${entity.errorMsg}',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'logout_result': '${entity.errorCode}--${entity.errorMsg}',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -218,7 +218,15 @@ class _AdvancedCalendarState extends State<AdvancedCalendar>
|
|||||||
keepLineSize: widget.keepLineSize,
|
keepLineSize: widget.keepLineSize,
|
||||||
weekNames: _weekNames != null
|
weekNames: _weekNames != null
|
||||||
? _weekNames!
|
? _weekNames!
|
||||||
: <String>['简写周日'.tr, '简写周一'.tr, '简写周二'.tr, '简写周三'.tr, '简写周四'.tr, '简写周五'.tr, '简写周六'.tr],
|
: <String>[
|
||||||
|
'简写周日'.tr,
|
||||||
|
'简写周一'.tr,
|
||||||
|
'简写周二'.tr,
|
||||||
|
'简写周三'.tr,
|
||||||
|
'简写周四'.tr,
|
||||||
|
'简写周五'.tr,
|
||||||
|
'简写周六'.tr
|
||||||
|
],
|
||||||
),
|
),
|
||||||
AnimatedBuilder(
|
AnimatedBuilder(
|
||||||
animation: _animationController,
|
animation: _animationController,
|
||||||
@ -324,7 +332,8 @@ class _AdvancedCalendarState extends State<AdvancedCalendar>
|
|||||||
controller: _weekPageController,
|
controller: _weekPageController,
|
||||||
itemCount: _weekRangeList.length,
|
itemCount: _weekRangeList.length,
|
||||||
physics: _closeMonthScroll(),
|
physics: _closeMonthScroll(),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context,
|
||||||
|
int index) {
|
||||||
return WeekView(
|
return WeekView(
|
||||||
innerDot: widget.innerDot,
|
innerDot: widget.innerDot,
|
||||||
dates: _weekRangeList[index],
|
dates: _weekRangeList[index],
|
||||||
@ -384,8 +393,8 @@ class _AdvancedCalendarState extends State<AdvancedCalendar>
|
|||||||
void _handleWeekDateChanged(DateTime date) {
|
void _handleWeekDateChanged(DateTime date) {
|
||||||
_handleDateChanged(date);
|
_handleDateChanged(date);
|
||||||
|
|
||||||
_monthViewCurrentPage.value = _monthRangeList
|
_monthViewCurrentPage.value = _monthRangeList.lastIndexWhere(
|
||||||
.lastIndexWhere((ViewRange monthRange) => monthRange.dates.contains(date));
|
(ViewRange monthRange) => monthRange.dates.contains(date));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _handleDateChanged(DateTime date) {
|
void _handleDateChanged(DateTime date) {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@ -13,7 +12,6 @@ import 'package:star_lock/tools/storage.dart';
|
|||||||
///
|
///
|
||||||
///
|
///
|
||||||
class BuglyTool {
|
class BuglyTool {
|
||||||
|
|
||||||
static int time = 0;
|
static int time = 0;
|
||||||
|
|
||||||
static Future<void> init() async {
|
static Future<void> init() async {
|
||||||
@ -69,27 +67,27 @@ class BuglyTool {
|
|||||||
bool begin = false,
|
bool begin = false,
|
||||||
Map? data,
|
Map? data,
|
||||||
}) async {
|
}) async {
|
||||||
String getMessage = '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- message:$message detail:$detail';
|
String getMessage =
|
||||||
if(begin == true){
|
'${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- message:$message detail:$detail';
|
||||||
|
if (begin == true) {
|
||||||
// 开始
|
// 开始
|
||||||
uploadStr = '';
|
uploadStr = '';
|
||||||
}else{
|
} else {
|
||||||
uploadStr = '$uploadStr \n<----------->\n $getMessage';
|
uploadStr = '$uploadStr \n<----------->\n $getMessage';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(upload){
|
if (upload) {
|
||||||
// AppLog.log('message:${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- 开门事件 detail:$uploadStr');
|
// AppLog.log('message:${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- 开门事件 detail:$uploadStr');
|
||||||
// FlutterBugly.uploadException(message: '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- 开门事件', detail: uploadStr, data: data);
|
// FlutterBugly.uploadException(message: '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- 开门事件', detail: uploadStr, data: data);
|
||||||
|
|
||||||
BuglyTool.uploadExceptionWithEvent(eventStr:eventStr, detail: uploadStr);
|
BuglyTool.uploadExceptionWithEvent(eventStr: eventStr, detail: uploadStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Future<void> uploadExceptionWithEvent({
|
static Future<void> uploadExceptionWithEvent({
|
||||||
required String eventStr,
|
required String eventStr,
|
||||||
required String detail,
|
required String detail,
|
||||||
}) async {
|
}) async {
|
||||||
FlutterBugly.uploadException(message: '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+${time == 0 ? DateTime.now().millisecondsSinceEpoch : 0}--- $eventStr', detail: detail);
|
// FlutterBugly.uploadException(message: '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+${time == 0 ? DateTime.now().millisecondsSinceEpoch : 0}--- $eventStr', detail: detail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user