Browse Source

neon: make AppImplementation provide a widget getter as a main page

pull/363/head
Nikolas Rimikis 2 years ago
parent
commit
e0b5dae11e
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 6
      packages/neon/neon/lib/src/pages/home.dart
  2. 2
      packages/neon/neon/lib/src/utils/app_implementation.dart
  3. 2
      packages/neon/neon_files/lib/neon_files.dart
  4. 2
      packages/neon/neon_news/lib/neon_news.dart
  5. 2
      packages/neon/neon_notes/lib/neon_notes.dart
  6. 2
      packages/neon/neon_notifications/lib/neon_notifications.dart

6
packages/neon/neon/lib/src/pages/home.dart

@ -150,7 +150,7 @@ class _HomePageState extends State<HomePage> {
],
),
),
body: app.buildPage(context, _appsBloc),
body: app.page,
),
),
);
@ -526,9 +526,7 @@ class _HomePageState extends State<HomePage> {
] else ...[
if (activeAppIDSnapshot.hasData) ...[
Expanded(
child: appImplementations.data!
.find(activeAppIDSnapshot.data!)!
.buildPage(context, _appsBloc),
child: appImplementations.data!.find(activeAppIDSnapshot.data!)!.page,
),
],
],

2
packages/neon/neon/lib/src/utils/app_implementation.dart

@ -30,7 +30,7 @@ abstract class AppImplementation<T extends Bloc, R extends NextcloudAppSpecificO
BehaviorSubject<int>? getUnreadCounter(final AppsBloc appsBloc);
Widget buildPage(final BuildContext context, final AppsBloc appsBloc);
Widget get page;
Widget buildIcon(
final BuildContext context, {

2
packages/neon/neon_files/lib/neon_files.dart

@ -62,7 +62,7 @@ class FilesApp extends AppImplementation<FilesBloc, FilesAppSpecificOptions> {
);
@override
Widget buildPage(final BuildContext context, final AppsBloc appsBloc) => const FilesMainPage();
Widget get page => const FilesMainPage();
@override
BehaviorSubject<int>? getUnreadCounter(final AppsBloc appsBloc) => null;

2
packages/neon/neon_news/lib/neon_news.dart

@ -68,7 +68,7 @@ class NewsApp extends AppImplementation<NewsBloc, NewsAppSpecificOptions> {
);
@override
Widget buildPage(final BuildContext context, final AppsBloc appsBloc) => const NewsMainPage();
Widget get page => const NewsMainPage();
@override
BehaviorSubject<int> getUnreadCounter(final AppsBloc appsBloc) => appsBloc.getAppBloc<NewsBloc>(this).unreadCounter;

2
packages/neon/neon_notes/lib/neon_notes.dart

@ -58,7 +58,7 @@ class NotesApp extends AppImplementation<NotesBloc, NotesAppSpecificOptions> {
);
@override
Widget buildPage(final BuildContext context, final AppsBloc appsBloc) => const NotesMainPage();
Widget get page => const NotesMainPage();
@override
BehaviorSubject<int>? getUnreadCounter(final AppsBloc appsBloc) => null;

2
packages/neon/neon_notifications/lib/neon_notifications.dart

@ -37,7 +37,7 @@ class NotificationsApp extends NotificationsAppInterface {
);
@override
Widget buildPage(final BuildContext context, final AppsBloc appsBloc) => const NotificationsMainPage();
Widget get page => const NotificationsMainPage();
@override
BehaviorSubject<int> getUnreadCounter(final AppsBloc appsBloc) =>

Loading…
Cancel
Save