eventBus property Null safety

EventBus eventBus

Allows to listens for events

If no event bus is specified in the constructor, an aysnchronous bus is used. Usage:

eventBus.on<ImapExpungeEvent>().listen((event) {
  // All events are of type ImapExpungeEvent (or subtypes of it).
  log(event.messageSequenceId);
});

eventBus.on<ImapEvent>().listen((event) {
  // All events are of type ImapEvent (or subtypes of it).
  log(event.eventType);
});

Implementation

EventBus get eventBus => _eventBus;