Merge pull request #4878 from 21pages/fix_chat

Fix chat
This commit is contained in:
RustDesk
2023-07-05 22:26:48 +08:00
committed by GitHub
5 changed files with 76 additions and 42 deletions

View File

@@ -160,8 +160,22 @@ class ConnectionManagerState extends State<ConnectionManager> {
child: label),
Obx(() => Offstage(
offstage:
!(client?.hasUnreadChatMessage.value ?? false),
child: Icon(Icons.circle, color: Colors.red, size: 10)))
!((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)))
],
);
},
@@ -170,7 +184,9 @@ class ConnectionManagerState extends State<ConnectionManager> {
Consumer<ChatModel>(
builder: (_, model, child) => model.isShowCMChatPage
? Expanded(
child: ChatPage(),
child: buildRemoteBlock(
child: ChatPage(),
),
flex: (kConnectionManagerWindowSizeOpenChat.width -
kConnectionManagerWindowSizeClosedChat
.width)