|
|
@ -1,20 +1,21 @@ |
|
|
|
part of '../neon_notifications.dart'; |
|
|
|
part of '../neon_notifications.dart'; |
|
|
|
|
|
|
|
|
|
|
|
abstract class NotificationsBlocEvents { |
|
|
|
abstract interface class NotificationsBlocEvents { |
|
|
|
void deleteNotification(final int id); |
|
|
|
void deleteNotification(final int id); |
|
|
|
|
|
|
|
|
|
|
|
void deleteAllNotifications(); |
|
|
|
void deleteAllNotifications(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
abstract class NotificationsBlocStates { |
|
|
|
abstract interface class NotificationsBlocStates { |
|
|
|
BehaviorSubject<Result<List<NextcloudNotificationsNotification>>> get notifications; |
|
|
|
BehaviorSubject<Result<List<NextcloudNotificationsNotification>>> get notifications; |
|
|
|
|
|
|
|
|
|
|
|
BehaviorSubject<int> get unreadCounter; |
|
|
|
BehaviorSubject<int> get unreadCounter; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class NotificationsBloc extends NotificationsBlocInterface implements NotificationsBlocEvents, NotificationsBlocStates { |
|
|
|
class NotificationsBloc extends InteractiveBloc |
|
|
|
|
|
|
|
implements NotificationsBlocInterface, NotificationsBlocEvents, NotificationsBlocStates { |
|
|
|
NotificationsBloc( |
|
|
|
NotificationsBloc( |
|
|
|
super.options, |
|
|
|
this.options, |
|
|
|
this._requestManager, |
|
|
|
this._requestManager, |
|
|
|
this._client, |
|
|
|
this._client, |
|
|
|
) { |
|
|
|
) { |
|
|
@ -27,6 +28,8 @@ class NotificationsBloc extends NotificationsBlocInterface implements Notificati |
|
|
|
unawaited(refresh()); |
|
|
|
unawaited(refresh()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
final NotificationsAppSpecificOptions options; |
|
|
|
final RequestManager _requestManager; |
|
|
|
final RequestManager _requestManager; |
|
|
|
final NextcloudClient _client; |
|
|
|
final NextcloudClient _client; |
|
|
|
|
|
|
|
|
|
|
|