Browse Source

Merge pull request #851 from Sanskar2807/main

Disabled mark all notifications as read button when no notifications …
pull/889/head
Kate 1 year ago committed by GitHub
parent
commit
919752e48b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      packages/neon/neon_notifications/lib/pages/main.dart

14
packages/neon/neon_notifications/lib/pages/main.dart

@ -28,12 +28,16 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
stream: bloc.notifications,
builder: (final context, final notifications) => Scaffold(
resizeToAvoidBottomInset: false,
floatingActionButton: FloatingActionButton(
onPressed: () async {
bloc.deleteAllNotifications();
floatingActionButton: StreamBuilder<int>(
stream: bloc.unreadCounter,
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(
scrollKey: 'notifications-notifications',

Loading…
Cancel
Save