|
|
@@ -113,9 +113,15 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
enablePullUp: true, |
|
|
|
child: ListView.builder( |
|
|
|
padding: const EdgeInsets.only(left: 12.5, right: 12.5, top: 8), |
|
|
|
itemCount: styleModel?.main_notification?.length ?? 0, |
|
|
|
itemCount: styleModel?.main_notification?.list?.length ?? 0, |
|
|
|
itemBuilder: (context, index) { |
|
|
|
return _buildMessageCenterStyleWidget(styleModel?.main_notification[index], index, styleModel?.main_notification?.length); |
|
|
|
return _buildMessageCenterStyleWidget( |
|
|
|
styleModel?.main_notification?.list[index], |
|
|
|
index, |
|
|
|
styleModel?.main_notification?.list?.length, |
|
|
|
styleModel?.main_notification?.unread_text_color, |
|
|
|
styleModel?.main_notification?.unread_bg_color, |
|
|
|
); |
|
|
|
}), |
|
|
|
), |
|
|
|
); |
|
|
@@ -148,7 +154,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
} |
|
|
|
|
|
|
|
/// 消息中心样式 |
|
|
|
Widget _buildMessageCenterStyleWidget(MainNotificationStyle styleModel, int index, int length) { |
|
|
|
Widget _buildMessageCenterStyleWidget(MainNotificationStyleItem styleModel, int index, int length, String unreadTextColor, String unreadBgColor) { |
|
|
|
var borderRadius = index == 0 |
|
|
|
? BorderRadius.only(topLeft: Radius.circular(7.5), topRight: Radius.circular(7.5)) |
|
|
|
: index == length - 1 ? BorderRadius.only(bottomRight: Radius.circular(7.5), bottomLeft: Radius.circular(7.5)) : BorderRadius.only(); |
|
|
@@ -163,7 +169,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
width: double.infinity, |
|
|
|
child: Row( |
|
|
|
children: <Widget>[ |
|
|
|
_buildCustomerAvatarWidget(icon: styleModel?.icon), |
|
|
|
_buildCustomerAvatarWidget(icon: styleModel?.icon, unreadBgColor: unreadBgColor, unreadTextColor: unreadTextColor), |
|
|
|
const SizedBox(width: 10), |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
@@ -415,7 +421,8 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
const SizedBox(height: 3), |
|
|
|
|
|
|
|
/// 内容 |
|
|
|
Text('点击查看回复详情', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'), fontSize: 11)) |
|
|
|
Text('点击查看回复详情', |
|
|
|
maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'), fontSize: 11)) |
|
|
|
], |
|
|
|
), |
|
|
|
) |
|
|
@@ -423,7 +430,9 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
), |
|
|
|
|
|
|
|
/// 时间 |
|
|
|
Padding(padding: const EdgeInsets.only(top: 16), child: Text(styleModel?.time_color ?? '2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex('#D8D8D8'), fontSize: 11))) |
|
|
|
Padding( |
|
|
|
padding: const EdgeInsets.only(top: 16), |
|
|
|
child: Text(styleModel?.time_color ?? '2020-06-23 01:00:06', style: TextStyle(color: HexColor.fromHex('#D8D8D8'), fontSize: 11))) |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
@@ -451,7 +460,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
} |
|
|
|
|
|
|
|
/// ================================= 自定义View ================================= /// |
|
|
|
Widget _buildCustomerAvatarWidget({@required String icon, String value}) { |
|
|
|
Widget _buildCustomerAvatarWidget({@required String icon, String value, String unreadTextColor, String unreadBgColor}) { |
|
|
|
return Container( |
|
|
|
// width: 30, |
|
|
|
// height: 30, |
|
|
@@ -476,12 +485,14 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine |
|
|
|
height: 12, |
|
|
|
padding: const EdgeInsets.only(left: 3, right: 3, top: 1, bottom: 1), |
|
|
|
alignment: Alignment.center, |
|
|
|
decoration: |
|
|
|
BoxDecoration(color: HexColor.fromHex('#FF4242'), borderRadius: BorderRadius.circular(6), border: Border.all(color: HexColor.fromHex('#FFFFFF'), width: 0.5)), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: HexColor.fromHex(unreadBgColor ?? '#FF4242'), |
|
|
|
borderRadius: BorderRadius.circular(6), |
|
|
|
border: Border.all(color: HexColor.fromHex('#FFFFFF'), width: 0.5)), |
|
|
|
child: Text( |
|
|
|
'18', |
|
|
|
textAlign: TextAlign.center, |
|
|
|
style: TextStyle(fontSize: 9, color: HexColor.fromHex('#FFFFFF')), |
|
|
|
style: TextStyle(fontSize: 9, color: HexColor.fromHex(unreadTextColor ?? '#FFFFFF')), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|