on<T extends AppEvent> method

  1. @override
Stream<T> on<T extends AppEvent>()
override

Subscribe EventBus on a specific type of event, and register responder to it.

Implementation

@override
Stream<T> on<T extends AppEvent>() {
  if (T == dynamic) {
    return _lastEventSubject.stream as Stream<T>;
  } else {
    return _lastEventSubject.stream.where((event) => event is T).cast<T>();
  }
}