when remote page receive chat message: if minimized, top page and switch tab, otherwise add unread message count

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-07-06 09:40:03 +08:00
parent 87e06e974e
commit a5675c06e7
7 changed files with 78 additions and 22 deletions

View File

@@ -158,24 +158,7 @@ class ConnectionManagerState extends State<ConnectionManager> {
message: key,
waitDuration: Duration(seconds: 1),
child: label),
Obx(() => Offstage(
offstage:
!((client?.unreadChatMessageCount.value ?? 0) > 0),
child: Container(
width: 16,
height: 16,
decoration: BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: Center(
child: Text(
"${client?.unreadChatMessageCount.value ?? 0}",
maxLines: 1,
style: TextStyle(
color: Colors.white, fontSize: 10)),
),
).marginOnly(left: 4)))
unreadMessageCountBuilder(client?.unreadChatMessageCount),
],
);
},