diff --git a/star_lock/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart b/star_lock/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart index 33bfe351..3c166332 100644 --- a/star_lock/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart +++ b/star_lock/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart @@ -28,8 +28,6 @@ class _DoorLockLogPageState extends State { @override Widget build(BuildContext context) { - final theme = Theme.of(context); - return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( @@ -58,139 +56,137 @@ class _DoorLockLogPageState extends State { mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start, children: [ - 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, - highlightColor: Colors.yellow, - disabledColor: Colors.green, - ), - child: 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, - ), - ), + topAdvancedCalendarWidget(), + Divider( + height: 1, + color: AppColors.greyLineColor, + indent: 30.w, + endIndent: 30.w, ), - Row(children: [ - SizedBox( - width: 30.w, - ), - Obx(() => DropdownButton( - value: state.dropdownValue.value, - icon: const Icon(Icons.arrow_drop_down), - iconSize: 40, - elevation: 12, - style: TextStyle(fontSize: 26.sp, color: Colors.black), - iconEnabledColor: Colors.grey, - onChanged: (newValue) { - state.dropdownValue.value = newValue!; - }, - items: state.dropDownItemList.obs - .map>((item) { - return DropdownMenuItem( - value: item, - child: Text(item), - ); - }).toList(), - )) - ]), + eventDropDownWidget(), SizedBox( height: 20.h, ), - Expanded( - child: Container( - margin: EdgeInsets.only(left: 20.w, right: 20.w), - //给contain设置一个10像素的圆角 - decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.circular(16.w)), - child: Timeline.tileBuilder( - builder: TimelineTileBuilder.fromStyle( - contentsAlign: ContentsAlign.basic, - contentsBuilder: (context, index) => Padding( - padding: EdgeInsets.all(24.0.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('09:30 有人出现在门口', - textAlign: TextAlign.left, - style: TextStyle( - color: AppColors.darkGrayTextColor, - fontSize: 24.sp, - )), - SizedBox( - height: 10.h, - ), - const Image( - image: AssetImage( - 'images/main/icon_lockDetail_monitoringvoiceFrist.png')), - ], - ), - ), - itemCount: 10, - ), - theme: TimelineThemeData( - nodePosition: 0.04, //居左侧距离 - connectorTheme: const ConnectorThemeData( - thickness: 2.0, - color: AppColors.greyBackgroundColor, - indent: 0.5), - indicatorTheme: const IndicatorThemeData( - size: 16.0, - color: AppColors.greyBackgroundColor, - position: 0.07), - ), - ), - )), + Expanded(child: timeLineView()), ], ), ); } - String getTypeIcon(int type) { - String title = 'images/controls_user.png'; - switch (type) { - case 1: - // 蓝牙开锁 - title = 'images/controls_user.png'; - break; - case 4: - // 密码开锁 - title = 'images/icon_password.png'; - break; - case 7: - // ic卡 - title = 'images/icon_card.png'; - break; - case 8: - // 指纹开锁 - title = 'images/icon_fingerprint.png'; - break; - default: - break; - } - return title; + //顶部日历小部件 + Widget topAdvancedCalendarWidget() { + final theme = Theme.of(context); + 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, + highlightColor: AppColors.blackColor, + disabledColor: Colors.grey, + ), + child: 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, + ), + ), + ); + } + +//事件下拉框组件 + Widget eventDropDownWidget() { + return Row(children: [ + SizedBox( + width: 50.w, + ), + Obx(() => DropdownButton( + value: state.dropdownValue.value, + icon: const Icon(Icons.arrow_drop_down), + iconSize: 40, + // elevation: 12, + style: TextStyle( + fontSize: 26.sp, + color: Colors.black, + fontWeight: FontWeight.w600), + iconEnabledColor: Colors.grey, + underline: Container( + height: 0, + ), + onChanged: (newValue) { + state.dropdownValue.value = newValue!; + }, + items: state.dropDownItemList.obs + .map>((item) { + return DropdownMenuItem( + value: item, + child: Text(item), + ); + }).toList(), + )) + ]); + } + +//时间轴组件 + Widget timeLineView() { + return Container( + margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 20.h), + //给contain设置一个10像素的圆角 + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(16.w)), + child: Timeline.tileBuilder( + builder: TimelineTileBuilder.fromStyle( + contentsAlign: ContentsAlign.basic, + contentsBuilder: (context, index) => Padding( + padding: EdgeInsets.only(left: 20.w, top: 20.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('09:30 有人出现在门口', + textAlign: TextAlign.left, + style: TextStyle( + color: Colors.black, + fontSize: 24.sp, + fontWeight: FontWeight.w600)), + Image( + image: const AssetImage( + 'images/main/icon_lockDetail_monitoringvoiceFrist.png'), + width: 260.w, + height: 260.h, + ), + ], + ), + ), + itemCount: 10, + ), + 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.07), + ), + ), + ); } } diff --git a/star_lock/lib/main/lockDetail/face/addFace/addFace_logic.dart b/star_lock/lib/main/lockDetail/face/addFace/addFace_logic.dart index 783da3e1..3e66daa9 100644 --- a/star_lock/lib/main/lockDetail/face/addFace/addFace_logic.dart +++ b/star_lock/lib/main/lockDetail/face/addFace/addFace_logic.dart @@ -48,7 +48,7 @@ class AddFaceLogic extends BaseGetXController { switch (status) { case 0x00: //成功 - print("${reply.commandType!.typeValue} 人脸开始数据解析成功"); + // print("${reply.commandType!.typeValue} 人脸开始数据解析成功"); state.ifConnectScuess.value = true; // 最大图片数 diff --git a/star_lock/lib/main/lockDetail/face/addFace/addFace_page.dart b/star_lock/lib/main/lockDetail/face/addFace/addFace_page.dart index 6c755b11..bd015c22 100644 --- a/star_lock/lib/main/lockDetail/face/addFace/addFace_page.dart +++ b/star_lock/lib/main/lockDetail/face/addFace/addFace_page.dart @@ -69,8 +69,7 @@ class _AddFacePageState extends State { ? Container( padding: EdgeInsets.only(left: 20.w, right: 20.w), child: SubmitBtn( - btnName: - "准备好了,开始添加", //TranslationLoader.lanKeys!.next!.tr, + btnName: "准备好了,开始添加", borderRadius: 20.w, onClick: () { state.isClickAddFace.value = true;