publish method Null safety

void publish(
  1. E event
)

Implementation

void publish(E event) {
  _handlers.forEach(((handler) {
    handler.handle(event);
  }));
}