消息红点提示
This commit is contained in:
@@ -40,7 +40,7 @@ class _MessagePageState extends State<MessagePage> {
|
||||
void _fetchMessageData() {
|
||||
String type = messageController.model.type == 1 ? "app_vsm" : "app_system";
|
||||
messageController.updateMessageStatus(type: type);
|
||||
messageController.getMessageList().then((response) {
|
||||
messageController.getMessageList(type).then((response) {
|
||||
if (response.code != HttpStatusCodes.ok) {
|
||||
TopSlideNotification.show(
|
||||
// Get.context!,
|
||||
@@ -179,13 +179,13 @@ class _MessagePageState extends State<MessagePage> {
|
||||
onPageChanged: _onPageChanged,
|
||||
children: [
|
||||
Obx(() {
|
||||
final list = messageController.messageList;
|
||||
final list = messageController.bodyMessageList;
|
||||
return list.isEmpty
|
||||
? const NullDataWidget()
|
||||
: _buildMessageListView(list);
|
||||
}),
|
||||
Obx(() {
|
||||
final list = messageController.messageList;
|
||||
final list = messageController.systemMessageList;
|
||||
return list.isEmpty
|
||||
? const NullDataWidget()
|
||||
: _buildMessageListView(list);
|
||||
@@ -211,7 +211,13 @@ class _MessagePageState extends State<MessagePage> {
|
||||
),
|
||||
width: double.infinity,
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
onPressed: () async {
|
||||
// if (messageController.model.type == 1) {
|
||||
// messageController.updateMessageReadStatus("app_vsm", all: true);
|
||||
// } else {
|
||||
// messageController.updateMessageReadStatus("app_system", all: true);
|
||||
// }
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@@ -264,22 +270,45 @@ class _MessagePageState extends State<MessagePage> {
|
||||
height: 1.0,
|
||||
),
|
||||
),
|
||||
|
||||
Obx(() {
|
||||
return messageController.model.system_message_read == 1
|
||||
? Positioned(
|
||||
top: -4,
|
||||
right: -14,
|
||||
child: Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink();
|
||||
if (messageController.model.system_message_read == 1) {
|
||||
return Positioned(
|
||||
top: -4.rpx,
|
||||
right: -14.rpx,
|
||||
child: Container(
|
||||
width: 15.rpx,
|
||||
height: 15.rpx,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}),
|
||||
|
||||
// final allHaveReadTime =
|
||||
// messageController.systemMessageList.any(
|
||||
// (item) => !item.containsKey('read_time'),
|
||||
// );
|
||||
|
||||
// return allHaveReadTime
|
||||
// ? Positioned(
|
||||
// top: -4,
|
||||
// right: -14,
|
||||
// child: Container(
|
||||
// width: 15.rpx,
|
||||
// height: 15.rpx,
|
||||
// decoration: const BoxDecoration(
|
||||
// color: Colors.red,
|
||||
// shape: BoxShape.circle,
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// : const SizedBox.shrink();
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -313,21 +342,39 @@ class _MessagePageState extends State<MessagePage> {
|
||||
height: 1.0,
|
||||
),
|
||||
),
|
||||
// Obx(() {
|
||||
// return messageController.model.body_message_read == 1
|
||||
// ? Positioned(
|
||||
// top: -4,
|
||||
// right: -14,
|
||||
// child: Container(
|
||||
// width: 15.rpx,
|
||||
// height: 15.rpx,
|
||||
// decoration: const BoxDecoration(
|
||||
// color: Colors.red,
|
||||
// shape: BoxShape.circle,
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// : const SizedBox.shrink();
|
||||
// }),
|
||||
Obx(() {
|
||||
return messageController.model.body_message_read == 1
|
||||
? Positioned(
|
||||
top: -4,
|
||||
right: -14,
|
||||
child: Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink();
|
||||
if (messageController.model.body_message_read == 1) {
|
||||
return Positioned(
|
||||
top: -4.rpx,
|
||||
right: -14.rpx,
|
||||
child: Container(
|
||||
width: 15.rpx,
|
||||
height: 15.rpx,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user