EventManager constructor

EventManager({
  1. required EventHandlerStore eventHandlerStore,
  2. required List<EventObserver> observers,
  3. required DispatchStrategy defaultDispatchStrategy,
})

Creates a new EventManager.

eventHandlerStore is used to store the subscribed EventHandler's. These handlers are created by the on method.

observers can be provided to observe events dispatched.

defaultDispatchStrategy defines the strategy used when dispatching events. By default DispatchStrategy.concurrent is used.

Implementation

EventManager({
  required EventHandlerStore eventHandlerStore,
  required List<EventObserver> observers,
  required DispatchStrategy defaultDispatchStrategy,
})  : _eventHandlerStore = eventHandlerStore,
      _observers = observers,
      _defaultDispatchStrategy = defaultDispatchStrategy;