mobile unread chat

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-07-10 09:40:41 +08:00
parent 65529b10b6
commit 6c6f6c081e
5 changed files with 82 additions and 9 deletions

View File

@@ -2189,19 +2189,21 @@ Widget buildRemoteBlock({required Widget child, WhetherUseRemoteBlock? use}) {
));
}
Widget unreadMessageCountBuilder(RxInt? count) {
Widget unreadMessageCountBuilder(RxInt? count,
{double? size, double? fontSize, double? marginLeft}) {
return Obx(() => Offstage(
offstage: !((count?.value ?? 0) > 0),
child: Container(
width: 16,
height: 16,
width: size ?? 16,
height: size ?? 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)),
maxLines: 1,
style: TextStyle(color: Colors.white, fontSize: fontSize ?? 10)),
),
).marginOnly(left: 4)));
).marginOnly(left: marginLeft ?? 4)));
}