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

@@ -2140,3 +2140,20 @@ Widget buildRemoteBlock({required Widget child, WhetherUseRemoteBlock? use}) {
]),
));
}
Widget unreadMessageCountBuilder(RxInt? count) {
return Obx(() => Offstage(
offstage: !((count?.value ?? 0) > 0),
child: Container(
width: 16,
height: 16,
decoration: BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: Center(
child: Text("${count?.value ?? 0}",
maxLines: 1, style: TextStyle(color: Colors.white, fontSize: 10)),
),
).marginOnly(left: 4)));
}