Browse Source

neon_files, neon_news, neon_notes, neon_notifications: use injecet bloc

pull/363/head
Nikolas Rimikis 2 years ago
parent
commit
0e0753decc
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 10
      packages/neon/neon_files/lib/neon_files.dart
  2. 10
      packages/neon/neon_news/lib/neon_news.dart
  3. 10
      packages/neon/neon_notes/lib/neon_notes.dart
  4. 10
      packages/neon/neon_notifications/lib/neon_notifications.dart

10
packages/neon/neon_files/lib/neon_files.dart

@ -62,9 +62,13 @@ class FilesApp extends AppImplementation<FilesBloc, FilesAppSpecificOptions> {
);
@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<FilesBloc>(context, listen: false);
return FilesMainPage(
bloc: bloc,
);
}
@override
BehaviorSubject<int>? getUnreadCounter(final AppsBloc appsBloc) => null;

10
packages/neon/neon_news/lib/neon_news.dart

@ -68,9 +68,13 @@ class NewsApp extends AppImplementation<NewsBloc, NewsAppSpecificOptions> {
);
@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<NewsBloc>(context, listen: false);
return NewsMainPage(
bloc: bloc,
);
}
@override
BehaviorSubject<int> getUnreadCounter(final AppsBloc appsBloc) => appsBloc.getAppBloc<NewsBloc>(this).unreadCounter;

10
packages/neon/neon_notes/lib/neon_notes.dart

@ -58,9 +58,13 @@ class NotesApp extends AppImplementation<NotesBloc, NotesAppSpecificOptions> {
);
@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<NotesBloc>(context, listen: false);
return NotesMainPage(
bloc: bloc,
);
}
@override
BehaviorSubject<int>? getUnreadCounter(final AppsBloc appsBloc) => null;

10
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<NotificationsBloc>(context, listen: false);
return NotificationsMainPage(
bloc: bloc,
);
}
@override
BehaviorSubject<int> getUnreadCounter(final AppsBloc appsBloc) =>

Loading…
Cancel
Save