From 0e0753decc825d7a74ec146d69e26db0fb44d3e6 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Tue, 6 Jun 2023 20:06:07 +0200 Subject: [PATCH] neon_files, neon_news, neon_notes, neon_notifications: use injecet bloc --- packages/neon/neon_files/lib/neon_files.dart | 10 +++++++--- packages/neon/neon_news/lib/neon_news.dart | 10 +++++++--- packages/neon/neon_notes/lib/neon_notes.dart | 10 +++++++--- .../neon_notifications/lib/neon_notifications.dart | 10 +++++++--- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/packages/neon/neon_files/lib/neon_files.dart b/packages/neon/neon_files/lib/neon_files.dart index 88ab2f7a..a0ef69ce 100644 --- a/packages/neon/neon_files/lib/neon_files.dart +++ b/packages/neon/neon_files/lib/neon_files.dart @@ -62,9 +62,13 @@ class FilesApp extends AppImplementation { ); @override - Widget buildPage(final BuildContext context, final AppsBloc appsBloc) => FilesMainPage( - bloc: appsBloc.getAppBloc(this), - ); + Widget buildPage(final BuildContext context, final AppsBloc appsBloc) { + final bloc = Provider.of(context, listen: false); + + return FilesMainPage( + bloc: bloc, + ); + } @override BehaviorSubject? getUnreadCounter(final AppsBloc appsBloc) => null; diff --git a/packages/neon/neon_news/lib/neon_news.dart b/packages/neon/neon_news/lib/neon_news.dart index d9d239d2..6ee7237c 100644 --- a/packages/neon/neon_news/lib/neon_news.dart +++ b/packages/neon/neon_news/lib/neon_news.dart @@ -68,9 +68,13 @@ class NewsApp extends AppImplementation { ); @override - Widget buildPage(final BuildContext context, final AppsBloc appsBloc) => NewsMainPage( - bloc: appsBloc.getAppBloc(this), - ); + Widget buildPage(final BuildContext context, final AppsBloc appsBloc) { + final bloc = Provider.of(context, listen: false); + + return NewsMainPage( + bloc: bloc, + ); + } @override BehaviorSubject getUnreadCounter(final AppsBloc appsBloc) => appsBloc.getAppBloc(this).unreadCounter; diff --git a/packages/neon/neon_notes/lib/neon_notes.dart b/packages/neon/neon_notes/lib/neon_notes.dart index 65bb522e..2989bbc9 100644 --- a/packages/neon/neon_notes/lib/neon_notes.dart +++ b/packages/neon/neon_notes/lib/neon_notes.dart @@ -58,9 +58,13 @@ class NotesApp extends AppImplementation { ); @override - Widget buildPage(final BuildContext context, final AppsBloc appsBloc) => NotesMainPage( - bloc: appsBloc.getAppBloc(this), - ); + Widget buildPage(final BuildContext context, final AppsBloc appsBloc) { + final bloc = Provider.of(context, listen: false); + + return NotesMainPage( + bloc: bloc, + ); + } @override BehaviorSubject? getUnreadCounter(final AppsBloc appsBloc) => null; diff --git a/packages/neon/neon_notifications/lib/neon_notifications.dart b/packages/neon/neon_notifications/lib/neon_notifications.dart index 976804c4..45909d57 100644 --- a/packages/neon/neon_notifications/lib/neon_notifications.dart +++ b/packages/neon/neon_notifications/lib/neon_notifications.dart @@ -37,9 +37,13 @@ class NotificationsApp extends NotificationsAppInterface { ); @override - Widget buildPage(final BuildContext context, final AppsBloc appsBloc) => NotificationsMainPage( - bloc: appsBloc.getAppBloc(this), - ); + Widget buildPage(final BuildContext context, final AppsBloc appsBloc) { + final bloc = Provider.of(context, listen: false); + + return NotificationsMainPage( + bloc: bloc, + ); + } @override BehaviorSubject getUnreadCounter(final AppsBloc appsBloc) =>