|
@@ -10,7 +10,9 @@ import 'notification_helper.dart';
|
|
|
|
|
|
// Folder
|
|
|
typedef FolderNotificationCallback = void Function(
|
|
|
- FolderNotification, Either<Uint8List, FlowyError>);
|
|
|
+ FolderNotification,
|
|
|
+ Either<Uint8List, FlowyError>,
|
|
|
+);
|
|
|
|
|
|
class FolderNotificationParser
|
|
|
extends NotificationParser<FolderNotification, FlowyError> {
|
|
@@ -25,15 +27,21 @@ class FolderNotificationParser
|
|
|
}
|
|
|
|
|
|
typedef FolderNotificationHandler = Function(
|
|
|
- FolderNotification ty, Either<Uint8List, FlowyError> result);
|
|
|
+ FolderNotification ty,
|
|
|
+ Either<Uint8List, FlowyError> result,
|
|
|
+);
|
|
|
|
|
|
class FolderNotificationListener {
|
|
|
StreamSubscription<SubscribeObject>? _subscription;
|
|
|
FolderNotificationParser? _parser;
|
|
|
|
|
|
- FolderNotificationListener(
|
|
|
- {required String objectId, required FolderNotificationHandler handler})
|
|
|
- : _parser = FolderNotificationParser(id: objectId, callback: handler) {
|
|
|
+ FolderNotificationListener({
|
|
|
+ required String objectId,
|
|
|
+ required FolderNotificationHandler handler,
|
|
|
+ }) : _parser = FolderNotificationParser(
|
|
|
+ id: objectId,
|
|
|
+ callback: handler,
|
|
|
+ ) {
|
|
|
_subscription =
|
|
|
RustStreamReceiver.listen((observable) => _parser?.parse(observable));
|
|
|
}
|