import 'package:rxdart/rxdart.dart'; class LocalNotification { final String type; final String contents; final String tbCropId; LocalNotification(this.type, this.contents, this.tbCropId); } class NotificationsBloc { NotificationsBloc._internal(); static final NotificationsBloc instance = NotificationsBloc._internal(); final BehaviorSubject _notificationsStreamController = BehaviorSubject(); Stream get notificationsStream { return _notificationsStreamController; } void newNotification(LocalNotification notification) { _notificationsStreamController.sink.add(notification); } void dispose() { _notificationsStreamController?.close(); } }