setApplicationEventBus abstract method

void setApplicationEventBus(
  1. ApplicationEventBus? applicationEventBus
)

Sets the ApplicationEventBus that this component can use for event operations.

This method is called by the framework when an ApplicationEventBus is available. The event bus may be null if the event system is not enabled or configured.

Parameters:

  • applicationEventBus: The ApplicationEventBus instance, or null if not available

Example:

@override
void setApplicationEventBus(ApplicationEventBus? applicationEventBus) {
  _eventBus = applicationEventBus;
  if (_eventBus != null) {
    _setupEventSubscriptions();
  }
}

Implementation

void setApplicationEventBus(ApplicationEventBus? applicationEventBus);