This commit is contained in:
魏少阳 2024-01-26 14:11:02 +08:00
commit d0d406ff3d
3 changed files with 125 additions and 130 deletions

View File

@ -28,8 +28,6 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> {
@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<DoorLockLogPage> {
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<String>(
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<DropdownMenuItem<String>>((item) {
return DropdownMenuItem<String>(
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<String>(
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<DropdownMenuItem<String>>((item) {
return DropdownMenuItem<String>(
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),
),
),
);
}
}

View File

@ -48,7 +48,7 @@ class AddFaceLogic extends BaseGetXController {
switch (status) {
case 0x00:
//
print("${reply.commandType!.typeValue} 人脸开始数据解析成功");
// print("${reply.commandType!.typeValue} 人脸开始数据解析成功");
state.ifConnectScuess.value = true;
//

View File

@ -69,8 +69,7 @@ class _AddFacePageState extends State<AddFacePage> {
? 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;