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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
@ -58,139 +56,137 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Theme( topAdvancedCalendarWidget(),
data: theme.copyWith( Divider(
textTheme: theme.textTheme.copyWith( height: 1,
titleMedium: theme.textTheme.titleMedium!.copyWith( color: AppColors.greyLineColor,
fontSize: 16, indent: 30.w,
color: theme.colorScheme.secondary, endIndent: 30.w,
),
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,
),
),
), ),
Row(children: [ eventDropDownWidget(),
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(),
))
]),
SizedBox( SizedBox(
height: 20.h, height: 20.h,
), ),
Expanded( Expanded(child: timeLineView()),
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),
),
),
)),
], ],
), ),
); );
} }
String getTypeIcon(int type) { //
String title = 'images/controls_user.png'; Widget topAdvancedCalendarWidget() {
switch (type) { final theme = Theme.of(context);
case 1: return Theme(
// data: theme.copyWith(
title = 'images/controls_user.png'; textTheme: theme.textTheme.copyWith(
break; titleMedium: theme.textTheme.titleMedium!.copyWith(
case 4: fontSize: 16,
// color: theme.colorScheme.secondary,
title = 'images/icon_password.png'; ),
break; bodyLarge: theme.textTheme.bodyLarge!.copyWith(
case 7: fontSize: 14,
// ic卡 color: Colors.black54,
title = 'images/icon_card.png'; ),
break; bodyMedium: theme.textTheme.bodyMedium!.copyWith(
case 8: fontSize: 12,
// color: Colors.black87,
title = 'images/icon_fingerprint.png'; ),
break; ),
default: primaryColor: AppColors.mainColor,
break; highlightColor: AppColors.blackColor,
} disabledColor: Colors.grey,
return title; ),
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) { switch (status) {
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 人脸开始数据解析成功"); // print("${reply.commandType!.typeValue} 人脸开始数据解析成功");
state.ifConnectScuess.value = true; state.ifConnectScuess.value = true;
// //

View File

@ -69,8 +69,7 @@ class _AddFacePageState extends State<AddFacePage> {
? Container( ? Container(
padding: EdgeInsets.only(left: 20.w, right: 20.w), padding: EdgeInsets.only(left: 20.w, right: 20.w),
child: SubmitBtn( child: SubmitBtn(
btnName: btnName: "准备好了,开始添加",
"准备好了,开始添加", //TranslationLoader.lanKeys!.next!.tr,
borderRadius: 20.w, borderRadius: 20.w,
onClick: () { onClick: () {
state.isClickAddFace.value = true; state.isClickAddFace.value = true;