|
|
@ -251,25 +251,19 @@ class _NotificationIconButtonState extends State<NotificationIconButton> { |
|
|
|
final notificationsImplementationData = notificationsAppImplementation.data!; |
|
|
|
final notificationsImplementationData = notificationsAppImplementation.data!; |
|
|
|
final notificationBloc = notificationsImplementationData.getBloc(_account); |
|
|
|
final notificationBloc = notificationsImplementationData.getBloc(_account); |
|
|
|
|
|
|
|
|
|
|
|
return StreamBuilder<int>( |
|
|
|
|
|
|
|
stream: notificationsImplementationData.getUnreadCounter(notificationBloc), |
|
|
|
|
|
|
|
builder: (final context, final unreadCounterSnapshot) { |
|
|
|
|
|
|
|
final unreadCount = unreadCounterSnapshot.data ?? 0; |
|
|
|
|
|
|
|
return IconButton( |
|
|
|
return IconButton( |
|
|
|
key: Key('app-${notificationsImplementationData.id}'), |
|
|
|
key: Key('app-${notificationsImplementationData.id}'), |
|
|
|
onPressed: () async { |
|
|
|
onPressed: () async { |
|
|
|
await _openNotifications(notificationsImplementationData); |
|
|
|
await _openNotifications(notificationsImplementationData); |
|
|
|
}, |
|
|
|
}, |
|
|
|
tooltip: AppLocalizations.of(context).appImplementationName(notificationsImplementationData.id), |
|
|
|
tooltip: AppLocalizations.of(context).appImplementationName(notificationsImplementationData.id), |
|
|
|
icon: NeonAppImplementationIcon( |
|
|
|
icon: StreamBuilder<int>( |
|
|
|
|
|
|
|
stream: notificationsImplementationData.getUnreadCounter(notificationBloc), |
|
|
|
|
|
|
|
builder: (final context, final unreadCounterSnapshot) => NeonAppImplementationIcon( |
|
|
|
appImplementation: notificationsImplementationData, |
|
|
|
appImplementation: notificationsImplementationData, |
|
|
|
unreadCount: unreadCount, |
|
|
|
unreadCount: unreadCounterSnapshot.data, |
|
|
|
color: unreadCount > 0 |
|
|
|
), |
|
|
|
? Theme.of(context).colorScheme.primary |
|
|
|
|
|
|
|
: Theme.of(context).colorScheme.onBackground, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|