fix: 合并bugly分支到当前分支

This commit is contained in:
魏少阳 2024-12-04 15:21:27 +08:00
parent 202c97e0d3
commit debb1bfd40
9 changed files with 235 additions and 201 deletions

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
@ -52,9 +51,9 @@ class StarLockLoginLogic extends BaseGetXController {
deviceInfo: state.deviceInfoMap);
if (entity.errorCode!.codeIsSuccessful) {
UmengCommonSdk.onEvent('login_result', {
'account':state.emailOrPhone.value,
'date':DateTool().getNowDateWithType(1),
'login_res':'成功',
'account': state.emailOrPhone.value,
'date': DateTool().getNowDateWithType(1),
'login_res': '成功',
});
Storage.saveLoginData(entity.data);
@ -65,11 +64,11 @@ class StarLockLoginLogic extends BaseGetXController {
}
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
BlueManage().scanDevices.clear(); //
}else{
} else {
UmengCommonSdk.onEvent('login_result', {
'account':state.emailOrPhone.value,
'date':DateTool().getNowDateWithType(1),
'login_res':'${entity.errorCode}--${entity.errorMsg}',
'account': state.emailOrPhone.value,
'date': DateTool().getNowDateWithType(1),
'login_res': '${entity.errorCode}--${entity.errorMsg}',
});
}
}

View File

@ -26,7 +26,7 @@ import '../../../tools/storage.dart';
import '../lockOperatingRecord/keyOperationRecord_entity.dart';
class DoorLockLogLogic extends BaseGetXController {
DoorLockLogState state = DoorLockLogState();
final DoorLockLogState state = DoorLockLogState();
//
late StreamSubscription<Reply> _replySubscription;
@ -47,8 +47,7 @@ class DoorLockLogLogic extends BaseGetXController {
message: '查询锁记录结果,解析数据',
detail: '查询锁记录结果,解析数据:${reply.data}',
eventStr: '查询锁记录事件结果',
upload: true
);
upload: true);
state.isLockReceiveResponse = true;
cancelBlueConnetctToastTimer();
@ -121,13 +120,15 @@ class DoorLockLogLogic extends BaseGetXController {
// ()
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<String>? token = await Storage.getStringList(saveBlueToken);
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 String command = SenderReferEventRecordTimeCommand(
@ -144,37 +145,45 @@ class DoorLockLogLogic extends BaseGetXController {
).toString();
showEasyLoading();
showBlueConnetctToastTimer(isShowBlueConnetctToast:true, action: () async {
cancelBlueConnetctToastTimer();
showBlueConnetctToastTimer(
isShowBlueConnetctToast: true,
action: () async {
cancelBlueConnetctToastTimer();
final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('check_doorLockLog', {
'lockName':state.keyInfos.value.lockName!,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'open_lock_result':'超时',
});
final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('check_doorLockLog', {
'lockName': state.keyInfos.value.lockName!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'open_lock_result': '超时',
});
BuglyTool.uploadException(
message: '查询锁记录超时-查询锁记录失败',
detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
eventStr: '查询锁记录事件超时',
upload: true
);
if(state.isLockReceiveResponse == false){
dismissEasyLoading();
}
});
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionStateState) async {
BuglyTool.uploadException(
message: '查询锁记录超时-查询锁记录失败',
detail:
'添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
eventStr: '查询锁记录事件超时',
upload: true);
if (state.isLockReceiveResponse == false) {
dismissEasyLoading();
}
});
BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionStateState) async {
if (connectionStateState == BluetoothConnectionState.connected) {
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList =
changeStringListToIntList(privateKey!);
final List<String>? token = await Storage.getStringList(saveBlueToken);
final List<int> getTokenList = changeStringListToIntList(token!);
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
final List<String>? publicKey =
await Storage.getStringList(saveBluePublicKey);
final List<int> getPublicKeyList =
changeStringListToIntList(publicKey!);
IoSenderManage.senderReferEventRecordTimeCommand(
keyID: BlueManage().connectDeviceName,
@ -188,7 +197,8 @@ class DoorLockLogLogic extends BaseGetXController {
publicKey: getPublicKeyList,
privateKey: getPrivateKeyList,
);
} else if (connectionStateState == BluetoothConnectionState.disconnected) {
} else if (connectionStateState ==
BluetoothConnectionState.disconnected) {
if (state.ifCurrentScreen.value == true) {
showBlueConnetctToast();
}
@ -196,18 +206,19 @@ class DoorLockLogLogic extends BaseGetXController {
final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('check_doorLockLog', {
'lockName':state.keyInfos.value.lockName!,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'open_lock_result':'断开连接',
'lockName': state.keyInfos.value.lockName!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'open_lock_result': '断开连接',
});
BuglyTool.uploadException(
message: '查询锁记录超时-查询锁记录失败',
detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
detail:
'添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
eventStr: '查询锁记录事件断开连接',
upload: true
);
upload: true);
}
});
}
@ -238,7 +249,9 @@ class DoorLockLogLogic extends BaseGetXController {
///
StreamSubscription? _getDoorLockLogListRefreshUIEvent;
void _getDoorLockLogListRefreshUIAction() {
_getDoorLockLogListRefreshUIEvent = eventBus.on<DoorLockLogListRefreshUI>().listen((DoorLockLogListRefreshUI event) {
_getDoorLockLogListRefreshUIEvent = eventBus
.on<DoorLockLogListRefreshUI>()
.listen((DoorLockLogListRefreshUI event) {
state.currentSelectDate.value = event.getDoorLockLogTime;
// startDate为当天的0点
@ -281,7 +294,9 @@ class DoorLockLogLogic extends BaseGetXController {
if (list.isEmpty) {
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())!;
if (entity.errorCode!.codeIsSuccessful) {
if (state.ifHaveNext == true) {
@ -289,20 +304,22 @@ class DoorLockLogLogic extends BaseGetXController {
getLockRecordLastUploadDataTime();
} else {
UmengCommonSdk.onEvent('check_doorLockLog', {
'lockName':state.keyInfos.value.lockName!,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'open_lock_result':'成功',
'lockName': state.keyInfos.value.lockName!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'open_lock_result': '成功',
});
mockNetworkDataRequest(isRefresh: true);
}
dismissEasyLoading();
}else{
} else {
UmengCommonSdk.onEvent('check_doorLockLog', {
'lockName':state.keyInfos.value.lockName!,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'open_lock_result':'上传数据接口失败',
'lockName': state.keyInfos.value.lockName!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'open_lock_result': '上传数据接口失败',
});
dismissEasyLoading();
}

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -53,7 +52,9 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
),
onTap: () {
ShowTipView().showSureAlertDialog(
'1.锁没有联网密码、IC卡、指纹等开门记录无法实时上传可以点击右上角按钮然后读取记录。'.tr +'\n' + '2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录'.tr,
'1.锁没有联网密码、IC卡、指纹等开门记录无法实时上传可以点击右上角按钮然后读取记录。'.tr +
'\n' +
'2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录'.tr,
tipTitle: '看不到操作记录,可能原因有'.tr,
sureStr: '我知道了'.tr);
},
@ -121,25 +122,13 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
}
void _onMenuItemSelected(String value) {
if(value == '读取记录'.tr){
if (value == '读取记录'.tr) {
logic.mockNetworkDataRequest(isRefresh: true);
}else if(value == '清空记录'.tr){
ShowCupertinoAlertView().showClearOperationRecordAlert(
clearClick: () {
switch (value) {
case '读取记录':
{
state.isLockReceiveResponse = false;
logic.getLockRecordLastUploadDataTime();
}
break;
case '清空记录':
{
ShowCupertinoAlertView().showClearOperationRecordAlert(
clearClick: () {
logic.clearOperationRecordRequest();
});
}else if(value == '导出记录'.tr){
} else if (value == '清空记录'.tr) {
ShowCupertinoAlertView().showClearOperationRecordAlert(clearClick: () {
logic.clearOperationRecordRequest();
});
} else if (value == '导出记录'.tr) {
showDialog(
context: 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() {

View File

@ -69,13 +69,14 @@ class LockDetailLogic extends BaseGetXController {
detail: '开锁结果,解析数据 _replyOpenLock:${reply.data}',
upload: true);
if(status != 6){
if (status != 6) {
final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('open_lock', {
'lock_name':state.keyInfos.value.lockName!,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'open_lock_result':'${reply.data}',
'lock_name': state.keyInfos.value.lockName!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'open_lock_result': '${reply.data}',
});
}
@ -378,10 +379,11 @@ class LockDetailLogic extends BaseGetXController {
action: () async {
final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('open_lock', {
'lock_name':state.keyInfos.value.lockName!,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'open_lock_result':'超时',
'lock_name': state.keyInfos.value.lockName!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'open_lock_result': '超时',
});
resetOpenDoorState();
@ -419,14 +421,13 @@ class LockDetailLogic extends BaseGetXController {
message: '蓝牙连接失败-开锁失败',
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
upload: true);
upload: true
);
final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('open_lock', {
'lock_name':state.keyInfos.value.lockName!,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'open_lock_result':'断开连接',
'lock_name': state.keyInfos.value.lockName!,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'open_lock_result': '断开连接',
});
if (state.ifCurrentScreen.value == true) {

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -19,17 +18,20 @@ class LockOperatingRecordPage extends StatefulWidget {
const LockOperatingRecordPage({Key? key}) : super(key: key);
@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 LockOperatingRecordState state = Get.find<LockOperatingRecordLogic>().state;
final LockOperatingRecordState state =
Get.find<LockOperatingRecordLogic>().state;
Future<void> getHttpData() async {
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) {
logic.mockNetworkDataRequest().then((KeyOperationRecordEntity value){
logic.mockNetworkDataRequest().then((KeyOperationRecordEntity value) {
if (mounted) {
setState(() {});
}
@ -49,7 +51,9 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: state.recordName.value.isNotEmpty? state.recordName.value : '操作记录'.tr,
barTitle: state.recordName.value.isNotEmpty
? state.recordName.value
: '操作记录'.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
// actionsList: [
@ -75,11 +79,11 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
// ],
),
body: EasyRefreshTool(
onRefresh: (){
onRefresh: () {
logic.pageNo = 1;
getHttpData();
},
onLoad: (){
onLoad: () {
getHttpData();
},
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) {
@ -166,7 +173,8 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
return title;
}
Widget _operatingOneRecordItem(String userAvatarStr, String userNameStr, String unlockDescStr, Function() action) {
Widget _operatingOneRecordItem(String userAvatarStr, String userNameStr,
String unlockDescStr, Function() action) {
return GestureDetector(
onTap: action,
child: Container(
@ -181,23 +189,23 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Icon(Icons.access_time, size: 35.w),
SizedBox(width: 10.w,),
SizedBox(
width: 10.w,
),
Text(
unlockDescStr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 24.sp,
color: AppColors.darkGrayTextColor),
fontSize: 24.sp, color: AppColors.darkGrayTextColor),
),
SizedBox(width: 10.h),
Expanded(
child:Container(
child: Container(
margin: EdgeInsets.only(bottom: 3.w),
child: Row(
children: <Widget>[
Flexible(
child: Text(
userNameStr,
child: Text(userNameStr,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -298,6 +306,7 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
@override
void didChangeDependencies() {
super.didChangeDependencies();
///
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
}
@ -344,5 +353,4 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with
}
state.ifCurrentScreen.value = false;
}
}

View File

@ -1,4 +1,3 @@
import 'dart:async';
import 'package:flutter/scheduler.dart';
@ -126,11 +125,15 @@ class LockSetLogic extends BaseGetXController {
break;
case 0x06:
//
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList =
changeStringListToIntList(privateKey!);
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
final List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
final List<String>? publicKey =
await Storage.getStringList(saveBluePublicKey);
final List<int> publicKeyDataList =
changeStringListToIntList(publicKey!);
final List<String>? token = await Storage.getStringList(saveBlueToken);
final List<int> getTokenList = changeStringListToIntList(token!);
@ -292,11 +295,12 @@ class LockSetLogic extends BaseGetXController {
action: () async {
final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('delet_lock', {
'lock_name':BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'delet_type':'lock',
'delet_lock_result':'删除锁超时',
'lock_name': BlueManage().connectDeviceName,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'delet_type': 'lock',
'delet_lock_result': '删除锁超时',
});
dismissEasyLoading();
@ -329,11 +333,12 @@ class LockSetLogic extends BaseGetXController {
} else if (connectionState == BluetoothConnectionState.disconnected) {
final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('delet_lock', {
'lock_name':BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'delet_type':'lock',
'delet_lock_result':'删除锁断开',
'lock_name': BlueManage().connectDeviceName,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'delet_type': 'lock',
'delet_lock_result': '删除锁断开',
});
dismissEasyLoading();
@ -373,7 +378,7 @@ class LockSetLogic extends BaseGetXController {
// ()
Future<void> sendBurglarAlarm(int type) async {
if(state.sureBtnState.value == 1){
if (state.sureBtnState.value == 1) {
return;
}
state.sureBtnState.value = 1;
@ -553,10 +558,12 @@ class LockSetLogic extends BaseGetXController {
void deleyLockLogicOfRoles() {
if (state.lockBasicInfo.value.isLockOwner == 1) {
// q
state.showTipView.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
state.showTipView
.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
//
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) {
//
@ -591,11 +598,12 @@ class LockSetLogic extends BaseGetXController {
final String getMobile = (await Storage.getMobile())!;
if (entity.errorCode!.codeIsSuccessful) {
UmengCommonSdk.onEvent('delet_lock', {
'lock_name':BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'delet_type':'lock',
'delet_lock_result':'成功',
'lock_name': BlueManage().connectDeviceName,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'delet_type': 'lock',
'delet_lock_result': '成功',
});
BlueManage().connectDeviceMacAddress = '';
@ -607,13 +615,14 @@ class LockSetLogic extends BaseGetXController {
SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent());
});
}else{
} else {
UmengCommonSdk.onEvent('delet_lock', {
'lock_name':BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'delet_type':'lock',
'delet_lock_result':'${entity.errorCode}--${entity.errorMsg}',
'lock_name': BlueManage().connectDeviceName,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'delet_type': 'lock',
'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}',
});
}
}
@ -628,11 +637,12 @@ class LockSetLogic extends BaseGetXController {
final String getMobile = (await Storage.getMobile())!;
if (entity.errorCode!.codeIsSuccessful) {
UmengCommonSdk.onEvent('delet_lock', {
'lock_name':BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'delet_type':'key',
'delet_lock_result':'成功',
'lock_name': BlueManage().connectDeviceName,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'delet_type': 'key',
'delet_lock_result': '成功',
});
BlueManage().connectDeviceMacAddress = '';
@ -644,13 +654,14 @@ class LockSetLogic extends BaseGetXController {
SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent());
});
}else{
} else {
UmengCommonSdk.onEvent('delet_lock', {
'lock_name':BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'delet_type':'key',
'delet_lock_result':'${entity.errorCode}--${entity.errorMsg}',
'lock_name': BlueManage().connectDeviceName,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'delet_type': 'key',
'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}',
});
}
}

View File

@ -135,10 +135,11 @@ class MineSetLogic extends BaseGetXController {
final String getMobile = (await Storage.getMobile())!;
if (entity.errorCode!.codeIsSuccessful) {
UmengCommonSdk.onEvent('logout', {
'lock_name':BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'logout_result':'成功',
'lock_name': BlueManage().connectDeviceName,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'logout_result': '成功',
});
UdpHelp().closeUDP();
@ -150,12 +151,13 @@ class MineSetLogic extends BaseGetXController {
BlueManage().disconnect();
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
}else{
} else {
UmengCommonSdk.onEvent('logout', {
'lock_name':BlueManage().connectDeviceName,
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date':DateTool().getNowDateWithType(1),
'logout_result':'${entity.errorCode}--${entity.errorMsg}',
'lock_name': BlueManage().connectDeviceName,
'account':
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'logout_result': '${entity.errorCode}--${entity.errorMsg}',
});
}
}

View File

@ -218,7 +218,15 @@ class _AdvancedCalendarState extends State<AdvancedCalendar>
keepLineSize: widget.keepLineSize,
weekNames: _weekNames != null
? _weekNames!
: <String>['简写周日'.tr, '简写周一'.tr, '简写周二'.tr, '简写周三'.tr, '简写周四'.tr, '简写周五'.tr, '简写周六'.tr],
: <String>[
'简写周日'.tr,
'简写周一'.tr,
'简写周二'.tr,
'简写周三'.tr,
'简写周四'.tr,
'简写周五'.tr,
'简写周六'.tr
],
),
AnimatedBuilder(
animation: _animationController,
@ -324,7 +332,8 @@ class _AdvancedCalendarState extends State<AdvancedCalendar>
controller: _weekPageController,
itemCount: _weekRangeList.length,
physics: _closeMonthScroll(),
itemBuilder: (BuildContext context, int index) {
itemBuilder: (BuildContext context,
int index) {
return WeekView(
innerDot: widget.innerDot,
dates: _weekRangeList[index],
@ -384,8 +393,8 @@ class _AdvancedCalendarState extends State<AdvancedCalendar>
void _handleWeekDateChanged(DateTime date) {
_handleDateChanged(date);
_monthViewCurrentPage.value = _monthRangeList
.lastIndexWhere((ViewRange monthRange) => monthRange.dates.contains(date));
_monthViewCurrentPage.value = _monthRangeList.lastIndexWhere(
(ViewRange monthRange) => monthRange.dates.contains(date));
}
void _handleDateChanged(DateTime date) {

View File

@ -1,4 +1,3 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
@ -13,7 +12,6 @@ import 'package:star_lock/tools/storage.dart';
///
///
class BuglyTool {
static int time = 0;
static Future<void> init() async {
@ -69,27 +67,27 @@ class BuglyTool {
bool begin = false,
Map? data,
}) async {
String getMessage = '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- message:$message detail:$detail';
if(begin == true){
String getMessage =
'${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- message:$message detail:$detail';
if (begin == true) {
//
uploadStr = '';
}else{
} else {
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');
// 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({
required String eventStr,
required String detail,
}) 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);
}
}