desktop cm chat feat: disable auto jumpTo other page when current hasFocus & add unread message mark on tab

This commit is contained in:
csf
2022-10-26 23:50:36 +09:00
parent 5a905174e7
commit c100505fa1
6 changed files with 71 additions and 46 deletions

View File

@@ -139,14 +139,20 @@ class ConnectionManagerState extends State<ConnectionManager> {
selectedTabBackgroundColor:
Theme.of(context).hintColor.withOpacity(0.2),
tabBuilder: (key, icon, label, themeConf) {
final client = serverModel.clients.firstWhereOrNull(
(client) => client.id.toString() == key);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
icon,
Tooltip(
message: key,
waitDuration: Duration(seconds: 1),
child: label),
Obx(() => Offstage(
offstage:
!(client?.hasUnreadChatMessage.value ?? false),
child:
Icon(Icons.circle, color: Colors.red, size: 10)))
],
);
},