Skip to content

Commit

Permalink
Merge pull request #2017 from nextcloud/refactor/neon_notifications/o…
Browse files Browse the repository at this point in the history
…nly-listen-notifications-where-necessary
  • Loading branch information
provokateurin authored May 8, 2024
2 parents 2459347 + 1d8e0b9 commit 653055f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions packages/neon/neon_notifications/lib/src/pages/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {

@override
Widget build(BuildContext context) {
return ResultBuilder.behaviorSubject(
subject: bloc.notifications,
builder: (context, notifications) => Scaffold(
resizeToAvoidBottomInset: false,
floatingActionButton: StreamBuilder(
stream: bloc.unreadCounter,
builder: (context, snapshot) {
final unreadCount = snapshot.data ?? 0;
return FloatingActionButton(
onPressed: unreadCount > 0 ? bloc.deleteAllNotifications : null,
tooltip: NotificationsLocalizations.of(context).notificationsDismissAll,
child: const Icon(MdiIcons.checkAll),
);
},
),
body: NeonListView(
return Scaffold(
resizeToAvoidBottomInset: false,
floatingActionButton: StreamBuilder(
stream: bloc.unreadCounter,
builder: (context, snapshot) {
final unreadCount = snapshot.data ?? 0;
return FloatingActionButton(
onPressed: unreadCount > 0 ? bloc.deleteAllNotifications : null,
tooltip: NotificationsLocalizations.of(context).notificationsDismissAll,
child: const Icon(MdiIcons.checkAll),
);
},
),
body: ResultBuilder.behaviorSubject(
subject: bloc.notifications,
builder: (context, notifications) => NeonListView(
scrollKey: 'notifications-notifications',
isLoading: notifications.isLoading,
error: notifications.error,
Expand Down

0 comments on commit 653055f

Please sign in to comment.