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;
|
||||
switch (recordType) {
|
||||
case 10:
|
||||
return '${formatTimestampToHHmm(item.operateDate!)} ' +
|
||||
'指纹'.tr +
|
||||
'开锁'.tr +
|
||||
'(ID:${item.username})';
|
||||
if (item.username != null && item.username != '') {
|
||||
return '${formatTimestampToHHmm(item.operateDate!)} ' +
|
||||
'指纹'.tr +
|
||||
'开锁'.tr +
|
||||
'(ID:${item.username})';
|
||||
} else {
|
||||
return item.recordStr ?? '';
|
||||
}
|
||||
|
||||
case 20:
|
||||
return '${formatTimestampToHHmm(item.operateDate!)} ' +
|
||||
'密码'.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() {
|
||||
return TimelineTileBuilder.fromStyle(
|
||||
contentsAlign: ContentsAlign.basic,
|
||||
@ -416,7 +437,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
||||
);
|
||||
},
|
||||
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(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -428,7 +449,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
||||
_buildIDByType(timelineData),
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: _buildTextColorByType(timelineData),
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user