|
|
@ -28,12 +28,16 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> { |
|
|
|
stream: bloc.notifications, |
|
|
|
stream: bloc.notifications, |
|
|
|
builder: (final context, final notifications) => Scaffold( |
|
|
|
builder: (final context, final notifications) => Scaffold( |
|
|
|
resizeToAvoidBottomInset: false, |
|
|
|
resizeToAvoidBottomInset: false, |
|
|
|
floatingActionButton: FloatingActionButton( |
|
|
|
floatingActionButton: StreamBuilder<int>( |
|
|
|
onPressed: () async { |
|
|
|
stream: bloc.unreadCounter, |
|
|
|
bloc.deleteAllNotifications(); |
|
|
|
builder: (final context, final snapshot) { |
|
|
|
|
|
|
|
final unreadCount = snapshot.data ?? 0; |
|
|
|
|
|
|
|
return FloatingActionButton( |
|
|
|
|
|
|
|
onPressed: unreadCount > 0 ? bloc.deleteAllNotifications : null, |
|
|
|
|
|
|
|
tooltip: AppLocalizations.of(context).notificationsDismissAll, |
|
|
|
|
|
|
|
child: const Icon(MdiIcons.checkAll), |
|
|
|
|
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
tooltip: AppLocalizations.of(context).notificationsDismissAll, |
|
|
|
|
|
|
|
child: const Icon(MdiIcons.checkAll), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
body: NeonListView( |
|
|
|
body: NeonListView( |
|
|
|
scrollKey: 'notifications-notifications', |
|
|
|
scrollKey: 'notifications-notifications', |
|
|
|