once<T extends VyuhEvent> method

  1. @override
void once<T extends VyuhEvent>(
  1. VyuhEventListener<T> listener
)
override

Implementation

@override
void once<T extends VyuhEvent>(VyuhEventListener<T> listener) {
  late final StreamSubscription<T> subscription;
  subscription = _eventBus!.on<T>().listen((event) {
    listener(event);

    subscription.cancel();
  });
}