You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.5 KiB
51 lines
1.5 KiB
library notifications; |
|
|
|
import 'dart:async'; |
|
|
|
import 'package:flutter/material.dart'; |
|
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; |
|
import 'package:neon/neon.dart'; |
|
import 'package:neon_notifications/l10n/localizations.dart'; |
|
import 'package:nextcloud/nextcloud.dart'; |
|
import 'package:provider/provider.dart'; |
|
import 'package:rxdart/rxdart.dart'; |
|
|
|
part 'blocs/notifications.dart'; |
|
part 'options.dart'; |
|
part 'pages/main.dart'; |
|
|
|
class NotificationsApp extends NotificationsAppInterface { |
|
NotificationsApp(super.sharedPreferences, super.requestManager, super.platform); |
|
|
|
@override |
|
String id = 'notifications'; |
|
|
|
@override |
|
LocalizationsDelegate localizationsDelegate = AppLocalizations.delegate; |
|
|
|
@override |
|
List<Locale> supportedLocales = AppLocalizations.supportedLocales; |
|
|
|
@override |
|
NotificationsAppSpecificOptions buildOptions(final AppStorage storage) => NotificationsAppSpecificOptions(storage); |
|
|
|
@override |
|
NotificationsBloc buildBloc(final NextcloudClient client) => NotificationsBloc( |
|
options, |
|
requestManager, |
|
client, |
|
); |
|
|
|
@override |
|
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) => |
|
appsBloc.getAppBloc<NotificationsBloc>(this).unreadCounter; |
|
}
|
|
|