notificationStream method

Stream<NavigineNotification> notificationStream()

Implementation

Stream<NavigineNotification> notificationStream() {
  _notificationController = StreamController();
  _channel.invokeMethod('attachNotificationListener');
  _notificationController!.onCancel = () async {
    await _channel.invokeMethod('removeNotificationListener');
    _notificationController?.close();
    _notificationController = null;
  };
  return _notificationController!.stream;
}