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.
To load photos from device.
@param path:- path of file from where needs to show image.
Default path :- Camera.
@param maxCount:- Maximum number of photos will return.
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.