Just above the NavigationBus class there are a few one-liner class definitions for event types, which are used when forwarding events to specific listeners based on event type. An instance of EventBus is created and there is a getter for animation, which returns an AlwaysStoppedAnimation unless there is an instance of TabController available, at which point it will start to return that controller’s animation, to allow other widgets to drive themselves off the tab navigator’s changing animation value. There are also methods for registering new listeners. The first of these, registerNavigationListener(), is not used in this project but it provides an example of how the EventBus can be used to track navigation events app-wide to handle all sorts of things, from triggering background network requests to recording analytics or anything else. The other event listener, registerControllerAttachedListener, is used by the Background class to subscribe to events of type ControllerAttachedEvent.

When a TabController is registered on the bus, a reference to it is saved and animation events from it are are forwarded to the event bus via the handler onUpdateTabAnimation. Also, a ControllerAttachedEvent is fired down the bus to notify any related components to grab a new copy of the Animation, as in the case with the Background which begins in a fixed position only, and then starts to follow the tab navigator once the everything is up and running.