fix:调整报警事件的文本为红色显示
This commit is contained in:
parent
c6e43651e1
commit
23a4008d2d
@ -313,10 +313,15 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
final recordType = item.recordType;
|
final recordType = item.recordType;
|
||||||
switch (recordType) {
|
switch (recordType) {
|
||||||
case 10:
|
case 10:
|
||||||
return '${formatTimestampToHHmm(item.operateDate!)} ' +
|
if (item.username != null && item.username != '') {
|
||||||
'指纹'.tr +
|
return '${formatTimestampToHHmm(item.operateDate!)} ' +
|
||||||
'开锁'.tr +
|
'指纹'.tr +
|
||||||
'(ID:${item.username})';
|
'开锁'.tr +
|
||||||
|
'(ID:${item.username})';
|
||||||
|
} else {
|
||||||
|
return item.recordStr ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
case 20:
|
case 20:
|
||||||
return '${formatTimestampToHHmm(item.operateDate!)} ' +
|
return '${formatTimestampToHHmm(item.operateDate!)} ' +
|
||||||
'密码'.tr +
|
'密码'.tr +
|
||||||
@ -402,6 +407,22 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color _buildTextColorByType(DoorLockLogDataItem item) {
|
||||||
|
final recordType = item.recordType;
|
||||||
|
switch (recordType) {
|
||||||
|
case 120:
|
||||||
|
case 150:
|
||||||
|
case 130:
|
||||||
|
case 190:
|
||||||
|
case 200:
|
||||||
|
case 210:
|
||||||
|
case 220:
|
||||||
|
return Colors.red;
|
||||||
|
default:
|
||||||
|
return Colors.black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TimelineTileBuilder _timelineBuilderWidget() {
|
TimelineTileBuilder _timelineBuilderWidget() {
|
||||||
return TimelineTileBuilder.fromStyle(
|
return TimelineTileBuilder.fromStyle(
|
||||||
contentsAlign: ContentsAlign.basic,
|
contentsAlign: ContentsAlign.basic,
|
||||||
@ -416,7 +437,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(left: 20.w, top: 20.h,right: 20.w),
|
padding: EdgeInsets.only(left: 20.w, top: 20.h, right: 20.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -428,7 +449,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
|||||||
_buildIDByType(timelineData),
|
_buildIDByType(timelineData),
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black,
|
color: _buildTextColorByType(timelineData),
|
||||||
fontSize: 24.sp,
|
fontSize: 24.sp,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user