subscribe method Null safety

void Function() subscribe(
  1. EventHandler handler
)

Implementation

void Function() subscribe(EventHandler handler) {
  _handlers.add(handler);

  return () => _handlers.remove(handler);
}