2024-01-09 14:05:18 +08:00
|
|
|
|
import 'package:flutter/material.dart';
|
2024-04-28 15:00:13 +08:00
|
|
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
2024-01-09 14:05:18 +08:00
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
import 'package:get/get.dart';
|
2024-01-26 16:19:01 +08:00
|
|
|
|
import 'package:star_lock/appRouters.dart';
|
2024-02-26 17:56:30 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
2024-01-09 14:05:18 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_logic.dart';
|
2024-06-15 17:20:55 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_state.dart';
|
2024-06-19 11:02:21 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/doorLockLog/exportRecordDialog/exportRecordDialog_page.dart';
|
2024-05-16 10:19:01 +08:00
|
|
|
|
import 'package:star_lock/tools/EasyRefreshTool.dart';
|
2024-01-26 14:28:02 +08:00
|
|
|
|
import 'package:star_lock/tools/advancedCalendar/src/widget.dart';
|
2024-05-16 16:45:00 +08:00
|
|
|
|
import 'package:star_lock/tools/commonDataManage.dart';
|
2024-01-26 16:19:01 +08:00
|
|
|
|
import 'package:star_lock/tools/menuItem/xsDropDownWidget.dart';
|
2024-04-03 09:53:30 +08:00
|
|
|
|
import 'package:star_lock/tools/noData.dart';
|
2024-05-16 11:59:37 +08:00
|
|
|
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
2024-06-15 17:20:55 +08:00
|
|
|
|
import 'package:star_lock/tools/showTipView.dart';
|
2024-01-18 11:24:12 +08:00
|
|
|
|
import 'package:timelines/timelines.dart';
|
2024-01-09 14:05:18 +08:00
|
|
|
|
|
|
|
|
|
|
import '../../../app_settings/app_colors.dart';
|
2024-04-28 15:00:13 +08:00
|
|
|
|
import '../../../tools/appRouteObserver.dart';
|
2024-01-09 14:05:18 +08:00
|
|
|
|
import '../../../tools/titleAppBar.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class DoorLockLogPage extends StatefulWidget {
|
|
|
|
|
|
const DoorLockLogPage({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
State<DoorLockLogPage> createState() => _DoorLockLogPageState();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-13 17:43:44 +08:00
|
|
|
|
class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
2024-06-15 17:20:55 +08:00
|
|
|
|
final DoorLockLogLogic logic = Get.put(DoorLockLogLogic());
|
|
|
|
|
|
final DoorLockLogState state = Get.find<DoorLockLogLogic>().state;
|
2024-01-09 14:05:18 +08:00
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
|
|
|
|
|
appBar: TitleAppBar(
|
2024-07-25 14:40:02 +08:00
|
|
|
|
barTitle: '操作记录'.tr,
|
2024-01-09 14:05:18 +08:00
|
|
|
|
haveBack: true,
|
|
|
|
|
|
backgroundColor: AppColors.mainColor,
|
2024-06-15 17:20:55 +08:00
|
|
|
|
actionsList: <Widget>[
|
2024-05-16 16:45:00 +08:00
|
|
|
|
Visibility(
|
2024-06-20 13:54:39 +08:00
|
|
|
|
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1 ||
|
|
|
|
|
|
CommonDataManage().currentKeyInfo.keyRight == 1,
|
2024-06-15 17:20:55 +08:00
|
|
|
|
child: GestureDetector(
|
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
|
'images/icon_tips_Q.png',
|
|
|
|
|
|
width: 34.w,
|
|
|
|
|
|
height: 32.w,
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
),
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
ShowTipView().showSureAlertDialog(
|
2024-12-04 15:21:27 +08:00
|
|
|
|
'1.锁没有联网,密码、IC卡、指纹等开门记录无法实时上传,可以点击右上角按钮,然后读取记录。'.tr +
|
|
|
|
|
|
'\n' +
|
|
|
|
|
|
'2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录'.tr,
|
2024-08-21 18:31:19 +08:00
|
|
|
|
tipTitle: '看不到操作记录,可能原因有'.tr,
|
2024-06-19 11:02:21 +08:00
|
|
|
|
sureStr: '我知道了'.tr);
|
2024-06-15 17:20:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
)),
|
|
|
|
|
|
Visibility(
|
2024-06-20 13:54:39 +08:00
|
|
|
|
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1 ||
|
|
|
|
|
|
CommonDataManage().currentKeyInfo.keyRight == 1,
|
2024-06-15 17:20:55 +08:00
|
|
|
|
child: PopupMenuButton<String>(
|
|
|
|
|
|
onSelected: _onMenuItemSelected,
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
itemBuilder: (BuildContext context) {
|
|
|
|
|
|
return <PopupMenuEntry<String>>[
|
2024-08-21 18:31:19 +08:00
|
|
|
|
_buildCustomPopupMenuItem('读取记录'.tr),
|
2024-06-20 13:54:39 +08:00
|
|
|
|
if (CommonDataManage().currentKeyInfo.isLockOwner == 1)
|
|
|
|
|
|
const PopupMenuDivider(),
|
|
|
|
|
|
if (CommonDataManage().currentKeyInfo.isLockOwner == 1)
|
2024-08-21 18:31:19 +08:00
|
|
|
|
_buildCustomPopupMenuItem('清空记录'.tr),
|
2024-06-15 17:20:55 +08:00
|
|
|
|
const PopupMenuDivider(),
|
2024-08-21 18:31:19 +08:00
|
|
|
|
_buildCustomPopupMenuItem('导出记录'.tr),
|
2024-06-15 17:20:55 +08:00
|
|
|
|
];
|
|
|
|
|
|
},
|
|
|
|
|
|
icon: Image.asset(
|
|
|
|
|
|
'images/icon_bar_more.png',
|
|
|
|
|
|
height: 30.h,
|
|
|
|
|
|
width: 10.w,
|
|
|
|
|
|
),
|
|
|
|
|
|
offset: Offset(0, 70.h), // 设置弹出框位置偏移量
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
2024-05-16 11:59:37 +08:00
|
|
|
|
],
|
2024-01-09 14:05:18 +08:00
|
|
|
|
),
|
2024-01-18 11:24:12 +08:00
|
|
|
|
body: Column(
|
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
2024-10-31 17:09:06 +08:00
|
|
|
|
children: <Widget>[
|
2024-01-25 17:46:46 +08:00
|
|
|
|
topAdvancedCalendarWidget(),
|
|
|
|
|
|
Divider(
|
|
|
|
|
|
height: 1,
|
|
|
|
|
|
color: AppColors.greyLineColor,
|
|
|
|
|
|
indent: 30.w,
|
|
|
|
|
|
endIndent: 30.w,
|
2024-01-11 09:41:19 +08:00
|
|
|
|
),
|
2024-01-25 17:46:46 +08:00
|
|
|
|
eventDropDownWidget(),
|
2024-05-16 11:59:37 +08:00
|
|
|
|
Expanded(child: timeLineView())
|
2024-01-18 11:24:12 +08:00
|
|
|
|
],
|
2024-01-11 09:41:19 +08:00
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-15 17:20:55 +08:00
|
|
|
|
//
|
|
|
|
|
|
PopupMenuItem<String> _buildCustomPopupMenuItem(String value) {
|
|
|
|
|
|
return PopupMenuItem<String>(
|
|
|
|
|
|
value: value,
|
|
|
|
|
|
height: 46.h,
|
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
|
height: 46.h,
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
Text(value, style: TextStyle(color: Colors.white, fontSize: 22.sp)),
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void _onMenuItemSelected(String value) {
|
2024-12-04 15:21:27 +08:00
|
|
|
|
if (value == '读取记录'.tr) {
|
2024-08-21 18:31:19 +08:00
|
|
|
|
logic.mockNetworkDataRequest(isRefresh: true);
|
2024-12-04 15:21:27 +08:00
|
|
|
|
} else if (value == '清空记录'.tr) {
|
|
|
|
|
|
ShowCupertinoAlertView().showClearOperationRecordAlert(clearClick: () {
|
|
|
|
|
|
logic.clearOperationRecordRequest();
|
|
|
|
|
|
});
|
|
|
|
|
|
} else if (value == '导出记录'.tr) {
|
2024-08-21 18:31:19 +08:00
|
|
|
|
showDialog(
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
|
return ExportRecordDialog(
|
|
|
|
|
|
onExport: (String filePath) {
|
|
|
|
|
|
Get.toNamed(Routers.exportSuccessPage,
|
|
|
|
|
|
arguments: <String, String>{'filePath': filePath});
|
2024-06-19 11:02:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
);
|
2024-08-21 18:31:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
);
|
2024-06-15 17:20:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-12-04 15:21:27 +08:00
|
|
|
|
// 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;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
2024-06-15 17:20:55 +08:00
|
|
|
|
|
2024-01-25 17:46:46 +08:00
|
|
|
|
//顶部日历小部件
|
|
|
|
|
|
Widget topAdvancedCalendarWidget() {
|
2024-06-15 17:20:55 +08:00
|
|
|
|
final ThemeData theme = Theme.of(context);
|
2024-01-25 17:46:46 +08:00
|
|
|
|
return Theme(
|
|
|
|
|
|
data: theme.copyWith(
|
|
|
|
|
|
textTheme: theme.textTheme.copyWith(
|
|
|
|
|
|
titleMedium: theme.textTheme.titleMedium!.copyWith(
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
color: theme.colorScheme.secondary,
|
|
|
|
|
|
),
|
|
|
|
|
|
bodyLarge: theme.textTheme.bodyLarge!.copyWith(
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
color: Colors.black54,
|
|
|
|
|
|
),
|
|
|
|
|
|
bodyMedium: theme.textTheme.bodyMedium!.copyWith(
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
color: Colors.black87,
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
primaryColor: AppColors.mainColor,
|
2024-04-03 18:09:41 +08:00
|
|
|
|
highlightColor: Colors.yellow,
|
2024-01-25 17:46:46 +08:00
|
|
|
|
disabledColor: Colors.grey,
|
|
|
|
|
|
),
|
2024-05-16 10:19:01 +08:00
|
|
|
|
child: Stack(
|
2024-10-31 17:09:06 +08:00
|
|
|
|
children: <Widget>[
|
2024-05-16 10:19:01 +08:00
|
|
|
|
AdvancedCalendar(
|
|
|
|
|
|
controller: state.calendarControllerCustom,
|
|
|
|
|
|
events: state.events,
|
|
|
|
|
|
weekLineHeight: 48.0,
|
|
|
|
|
|
startWeekDay: 1,
|
|
|
|
|
|
innerDot: true,
|
|
|
|
|
|
keepLineSize: true,
|
|
|
|
|
|
calendarTextStyle: const TextStyle(
|
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
|
height: 1.3125,
|
|
|
|
|
|
letterSpacing: 0,
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
Positioned(
|
|
|
|
|
|
top: 8.0,
|
|
|
|
|
|
right: 8.0,
|
|
|
|
|
|
child: Obx(() => Text(
|
2024-08-27 11:08:44 +08:00
|
|
|
|
'${state.currentSelectDate.value.year}${'年'.tr}${state.currentSelectDate.value.month}${'月'.tr}',
|
2024-05-16 10:19:01 +08:00
|
|
|
|
style: theme.textTheme.titleMedium!.copyWith(
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
color: theme.colorScheme.secondary,
|
|
|
|
|
|
),
|
|
|
|
|
|
)),
|
|
|
|
|
|
),
|
|
|
|
|
|
],
|
2024-01-25 17:46:46 +08:00
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//事件下拉框组件
|
|
|
|
|
|
Widget eventDropDownWidget() {
|
2024-01-26 16:19:01 +08:00
|
|
|
|
return Container(
|
2024-02-27 13:52:49 +08:00
|
|
|
|
margin: EdgeInsets.only(top: 20.h, left: 30.w, bottom: 10.h, right: 20.w),
|
2024-01-26 16:19:01 +08:00
|
|
|
|
child: Row(
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
2024-06-15 17:20:55 +08:00
|
|
|
|
children: <Widget>[
|
2024-01-26 16:19:01 +08:00
|
|
|
|
Obx(() => XSDropDownWidget(
|
|
|
|
|
|
items: state.getDropDownItemList,
|
2024-02-01 10:52:23 +08:00
|
|
|
|
value: state.dropdownTitle.value,
|
|
|
|
|
|
valueChanged: (value) {
|
|
|
|
|
|
state.dropdownValue.value = int.parse(value);
|
2024-05-16 14:23:35 +08:00
|
|
|
|
logic.mockNetworkDataRequest(isRefresh: true);
|
2024-02-01 10:52:23 +08:00
|
|
|
|
})),
|
2024-01-26 16:19:01 +08:00
|
|
|
|
],
|
2024-01-25 17:46:46 +08:00
|
|
|
|
),
|
2024-01-26 16:19:01 +08:00
|
|
|
|
);
|
2024-01-25 17:46:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//时间轴组件
|
2024-05-16 11:59:37 +08:00
|
|
|
|
Widget timeLineView() {
|
2024-01-25 17:46:46 +08:00
|
|
|
|
return Container(
|
2024-01-26 14:28:02 +08:00
|
|
|
|
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 20.h, top: 20.h),
|
2024-01-25 17:46:46 +08:00
|
|
|
|
decoration: BoxDecoration(
|
2024-02-26 17:56:30 +08:00
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
borderRadius: BorderRadius.circular(16.w),
|
|
|
|
|
|
),
|
2024-05-16 14:23:35 +08:00
|
|
|
|
child: Obx(() => EasyRefreshTool(
|
|
|
|
|
|
onRefresh: () async {
|
|
|
|
|
|
logic.mockNetworkDataRequest(isRefresh: true);
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoad: () async {
|
|
|
|
|
|
logic.mockNetworkDataRequest(isRefresh: false);
|
|
|
|
|
|
},
|
|
|
|
|
|
child: state.lockLogItemList.isNotEmpty
|
|
|
|
|
|
? Timeline.tileBuilder(
|
|
|
|
|
|
builder: _timelineBuilderWidget(),
|
|
|
|
|
|
theme: TimelineThemeData(
|
|
|
|
|
|
nodePosition: 0.04, //居左侧距离
|
|
|
|
|
|
connectorTheme: const ConnectorThemeData(
|
|
|
|
|
|
thickness: 1.0,
|
|
|
|
|
|
color: AppColors.greyLineColor,
|
|
|
|
|
|
indent: 0.5,
|
|
|
|
|
|
),
|
|
|
|
|
|
indicatorTheme: const IndicatorThemeData(
|
|
|
|
|
|
size: 8.0,
|
|
|
|
|
|
color: AppColors.greyLineColor,
|
|
|
|
|
|
position: 0.4,
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
)
|
|
|
|
|
|
: NoData())),
|
2024-05-16 11:59:37 +08:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TimelineTileBuilder _timelineBuilderWidget() {
|
|
|
|
|
|
return TimelineTileBuilder.fromStyle(
|
|
|
|
|
|
contentsAlign: ContentsAlign.basic,
|
|
|
|
|
|
itemCount: state.lockLogItemList.length,
|
2024-06-15 17:20:55 +08:00
|
|
|
|
contentsBuilder: (BuildContext context, int index) {
|
|
|
|
|
|
final DoorLockLogDataItem timelineData = state.lockLogItemList[index];
|
|
|
|
|
|
final DateTime dateTime =
|
2024-05-16 11:59:37 +08:00
|
|
|
|
DateTime.fromMillisecondsSinceEpoch(timelineData.operateDate!);
|
2024-06-15 17:20:55 +08:00
|
|
|
|
final String formattedTime =
|
2024-05-16 11:59:37 +08:00
|
|
|
|
'${dateTime.hour.toString().padLeft(2, '0')}:${dateTime.minute.toString().padLeft(2, '0')}';
|
|
|
|
|
|
|
2024-07-17 16:29:25 +08:00
|
|
|
|
return GestureDetector(
|
|
|
|
|
|
onTap: () {
|
2024-08-07 10:54:36 +08:00
|
|
|
|
Get.toNamed(Routers.doorLockLogDetailPage,
|
|
|
|
|
|
arguments: {'doorLockLogDataItem': timelineData});
|
2024-07-17 16:29:25 +08:00
|
|
|
|
},
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
padding: EdgeInsets.only(left: 20.w, top: 20.h),
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
Text(
|
|
|
|
|
|
// '$formattedTime ${timelineData.username!.isNotEmpty ? "${timelineData.username}操作" : ""}${timelineData.recordTypeName}',
|
|
|
|
|
|
timelineData.recordStr ?? '',
|
|
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
fontSize: 24.sp,
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
),
|
2024-05-16 11:59:37 +08:00
|
|
|
|
),
|
2024-07-17 16:29:25 +08:00
|
|
|
|
SizedBox(
|
|
|
|
|
|
height: 10.h,
|
|
|
|
|
|
),
|
|
|
|
|
|
GestureDetector(
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
Get.toNamed(Routers.videoLogDetailPage);
|
|
|
|
|
|
},
|
|
|
|
|
|
child: Stack(
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
if (timelineData.imagesUrl!.isNotEmpty)
|
|
|
|
|
|
Image.network(
|
|
|
|
|
|
timelineData.imagesUrl!,
|
|
|
|
|
|
width: 260.w,
|
|
|
|
|
|
height: 260.h,
|
|
|
|
|
|
)
|
|
|
|
|
|
else
|
|
|
|
|
|
Container(),
|
|
|
|
|
|
Positioned(
|
|
|
|
|
|
top: 150.h,
|
|
|
|
|
|
left: 10.w,
|
|
|
|
|
|
child: Image(
|
|
|
|
|
|
image: const AssetImage(
|
|
|
|
|
|
'images/main/icon_lockLog_play.png'),
|
|
|
|
|
|
width: 24.w,
|
|
|
|
|
|
height: 20.w,
|
|
|
|
|
|
),
|
2024-05-16 11:59:37 +08:00
|
|
|
|
),
|
2024-07-17 16:29:25 +08:00
|
|
|
|
],
|
|
|
|
|
|
),
|
2024-05-16 11:59:37 +08:00
|
|
|
|
),
|
2024-07-17 16:29:25 +08:00
|
|
|
|
SizedBox(
|
|
|
|
|
|
height: 20.h,
|
|
|
|
|
|
),
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
2024-05-16 11:59:37 +08:00
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
},
|
2024-01-25 17:46:46 +08:00
|
|
|
|
);
|
2024-01-11 09:41:19 +08:00
|
|
|
|
}
|
2024-04-28 15:00:13 +08:00
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
void didChangeDependencies() {
|
|
|
|
|
|
super.didChangeDependencies();
|
|
|
|
|
|
|
|
|
|
|
|
/// 路由订阅
|
|
|
|
|
|
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
void dispose() {
|
|
|
|
|
|
/// 取消路由订阅
|
|
|
|
|
|
AppRouteObserver().routeObserver.unsubscribe(this);
|
|
|
|
|
|
super.dispose();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// 从上级界面进入 当前界面即将出现
|
|
|
|
|
|
@override
|
|
|
|
|
|
void didPush() {
|
|
|
|
|
|
super.didPush();
|
|
|
|
|
|
state.ifCurrentScreen.value = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// 返回上一个界面 当前界面即将消失
|
|
|
|
|
|
@override
|
|
|
|
|
|
void didPop() {
|
|
|
|
|
|
super.didPop();
|
|
|
|
|
|
logic.cancelBlueConnetctToastTimer();
|
2024-10-31 17:09:06 +08:00
|
|
|
|
if (EasyLoading.isShow) {
|
|
|
|
|
|
EasyLoading.dismiss(animation: true);
|
|
|
|
|
|
}
|
2024-04-28 15:00:13 +08:00
|
|
|
|
state.ifCurrentScreen.value = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// 从下级返回 当前界面即将出现
|
|
|
|
|
|
@override
|
|
|
|
|
|
void didPopNext() {
|
|
|
|
|
|
super.didPopNext();
|
|
|
|
|
|
state.ifCurrentScreen.value = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// 进入下级界面 当前界面即将消失
|
|
|
|
|
|
@override
|
|
|
|
|
|
void didPushNext() {
|
|
|
|
|
|
super.didPushNext();
|
|
|
|
|
|
logic.cancelBlueConnetctToastTimer();
|
2024-06-15 17:20:55 +08:00
|
|
|
|
if (EasyLoading.isShow) {
|
|
|
|
|
|
EasyLoading.dismiss(animation: true);
|
|
|
|
|
|
}
|
2024-04-28 15:00:13 +08:00
|
|
|
|
state.ifCurrentScreen.value = false;
|
|
|
|
|
|
}
|
2024-01-09 14:05:18 +08:00
|
|
|
|
}
|