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<SmtpConnectionLostEvent>().listen((event) {
  // All events are of type SmtpConnectionLostEvent (or subtypes of it).
  _log(event.type);
});

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

Implementation

EventBus get eventBus => _eventBus;