mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Automatically change the number of unread conversations
This commit is contained in:
@ -114,7 +114,8 @@ class ComunicAppBar extends StatefulWidget implements PreferredSizeWidget {
|
||||
final OnSelectMenuAction onTap;
|
||||
final BarCallbackActions selectedAction;
|
||||
|
||||
const ComunicAppBar({Key key, @required this.onTap, @required this.selectedAction})
|
||||
const ComunicAppBar(
|
||||
{Key key, @required this.onTap, @required this.selectedAction})
|
||||
: assert(onTap != null),
|
||||
super(key: key);
|
||||
|
||||
@ -137,6 +138,8 @@ class _ComunicAppBarState extends SafeState<ComunicAppBar> {
|
||||
// Listen to notifications number update
|
||||
this.listenChangeState<NewNumberNotifsEvent>(
|
||||
(d) => _unreadNotifications.notifications = d.newNum);
|
||||
this.listenChangeState<NewNumberUnreadConversations>(
|
||||
(d) => _unreadNotifications.conversations = d.newNum);
|
||||
}
|
||||
|
||||
void _refreshCountUnread() async {
|
||||
@ -176,7 +179,8 @@ class _ComunicAppBarState extends SafeState<ComunicAppBar> {
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: List.generate(
|
||||
_menuItems.length,
|
||||
(i) => _MenuItemWidget(
|
||||
(i) =>
|
||||
_MenuItemWidget(
|
||||
item: _menuItems[i],
|
||||
onTap: widget.onTap,
|
||||
isSelected: _menuItems[i].action == widget.selectedAction,
|
||||
|
Reference in New Issue
Block a user