Closes the event and stateStreams.
This method should be called when a Bloc is no longer needed.
Once close is called, events that are added will not be
In addition, if close is called while events are still being
processed, the Bloc will finish processing the pending events.
Called whenever a change occurs with the given change.
A change occurs when a new state is emitted.
onChange is called before the state of the cubit is updated.
onChange is a great spot to add logging/analytics for a specific cubit.
Called whenever a transition occurs with the given transition.
A transition occurs when a new event is added
and a new state is emitted from a corresponding EventHandler.
onTransition is called before a Bloc's state has been updated.
A great spot to add logging/analytics at the individual Bloc level.