addEventBus method

dynamic addEventBus({
  1. int maxHistoryLength = 10,
  2. bool allowLogging = false,
})

Add an EventBus to your Nylo project.

Implementation

addEventBus({int maxHistoryLength = 10, bool allowLogging = false}) {
  EventBus eventBus = EventBus(
    maxHistoryLength: maxHistoryLength,
    allowLogging: allowLogging,
  );
  final event = UpdateState();
  eventBus.watch(event);

  Backpack.instance.set("event_bus", eventBus);
}