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
processed.
In addition, if close is called while events are still being
processed, the Bloc will finish processing the pending events.
emit is only for internal use and should never be called directly
outside of tests. The Emitter instance provided to each EventHandler
should be used instead.
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.