CollageBloc class



CollageBloc({@required BuildContext context, @required CollageType collageType, String path})


collageType CollageType
context BuildContext
currentState CollageState
Returns the current State of the Bloc.
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
initialState CollageState
Returns the State before any Events have been dispatched.
read-only, override
path String
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
state Stream<CollageState>
Returns Stream of States. Usually consumed by the presentation layer.
read-only, inherited


askPermission(bool isFromPicker, PermissionType permissionType, int index) → dynamic
blankList() List<Images>
checkPermission(bool isFromPicker, PermissionType permissionType, int index) → dynamic
dispatch(CollageEvent event) → void
Takes an Event and triggers mapEventToState. Dispatch may be called from the presentation layer or from within the Bloc. Dispatch notifies the Bloc of a new Event. If dispose has already been called, any subsequent calls to dispatch will be delegated to the onError method which can be overriden at the Bloc as well as the BlocDelegate level.
dispatchCheckPermissionEvent({PermissionType permissionType, bool isFromPicker = false, int index = -1}) → void
dispatchRemovePhotoEvent(int index) → dynamic
dispose() → void
Closes the Event and State Streams. This method should be called when a Bloc is no longer needed. Once dispose is called, events that are dispatched will not be processed and will result in an error being passed to onError. In addition, if dispose is called while Events are still being processed, any States yielded after are ignored and will not result in a Transition.
@mustCallSuper, inherited
getImageCount() → dynamic
The no. of image return as per collage type.
loadImages(String path, int maxCount) Future
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.
mapEventToState(CollageEvent event) Stream<CollageState>
Must be implemented when a class extends Bloc. Takes the incoming event as the argument. mapEventToState is called whenever an Event is dispatched by the presentation layer. mapEventToState must convert that Event into a new State and return the new State in the form of a Stream which is consumed by the presentation layer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
onError(Object error, StackTrace stacktrace) → void
Called whenever an Exception is thrown within mapEventToState. By default all exceptions will be ignored and Bloc functionality will be unaffected. The stacktrace argument may be null if the state stream received an error without a StackTrace. A great spot to handle exceptions at the individual Bloc level.
onEvent(CollageEvent event) → void
Called whenever an Event is dispatched to the Bloc. A great spot to add logging/analytics at the individual Bloc level.
onTransition(Transition<CollageEvent, CollageState> transition) → void
Called whenever a Transition occurs with the given Transition. A Transition occurs when a new Event is dispatched and mapEventToState executed. onTransition is called before a Bloc's State has been updated. A great spot to add logging/analytics at the individual Bloc level.
openPicker(PermissionType permissionType, int index) → dynamic
showSnackBar({String msg = "Permission Denied."}) → dynamic
toString() String
A string representation of this object. [...]
transformEvents(Stream<CollageEvent> events, Stream<CollageState> next(CollageEvent event)) Stream<CollageState>
Transforms the Stream<Event> along with a next function into a Stream<State>. Events that should be processed by mapEventToState need to be passed to next. By default asyncExpand is used to ensure all events are processed in the order in which they are received. You can override transformEvents for advanced usage in order to manipulate the frequency and specificity with which mapEventToState is called as well as which events are processed. [...]
transformStates(Stream<CollageState> states) Stream<CollageState>
Transforms the Stream<State> into a new Stream<State>. By default transformStates returns the incoming Stream<State>. You can override transformStates for advanced usage in order to manipulate the frequency and specificity at which transitions (state changes) occur. [...]


operator ==(Object other) bool
The equality operator. [...]