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,
  );
  const event = UpdateState();
  eventBus.watch(event);

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