FourStateConsumer<B extends BlocBase<FourStates<T> > , T> constructor
FourStateConsumer<B extends BlocBase<FourStates<T> > , T> ({
- required SuccessBuilder<
T> succeedBuilder, - InitialBuilder? initialBuilder,
- LoadingBuilder? loadingBuilder,
- FailureBuilder? failureBuilder,
- SuccessListener<
T> ? succeedListener, - InitialListener? initialListener,
- LoadingListener? loadingListener,
- FailureListener? failureListener,
- B? bloc,
- BlocListenerCondition<
FourStates< ? listenWhen,T> > - BlocBuilderCondition<
FourStates< ? buildWhen,T> > - Key? key,
Implementation
FourStateConsumer({
required SuccessBuilder<T> succeedBuilder,
InitialBuilder? initialBuilder,
LoadingBuilder? loadingBuilder,
FailureBuilder? failureBuilder,
SuccessListener<T>? succeedListener,
InitialListener? initialListener,
LoadingListener? loadingListener,
FailureListener? failureListener,
B? bloc,
BlocListenerCondition<FourStates<T>>? listenWhen,
BlocBuilderCondition<FourStates<T>>? buildWhen,
super.key,
}) : super(
bloc: bloc,
listenWhen: listenWhen,
listener: (context, state) => state.mayBeMap(
orElse: () => null,
initialState: initialListener,
loadingState: loadingListener,
succeedState: succeedListener,
failedState: failureListener,
),
buildWhen: buildWhen,
builder: (context, state) => state.map(
initialState: initialBuilder ??
BlocEaseStateWidgetsProvider.of(context).initialStateBuilder,
loadingState: loadingBuilder ??
BlocEaseStateWidgetsProvider.of(context).loadingStateBuilder,
failedState: failureBuilder ??
BlocEaseStateWidgetsProvider.of(context).failureStateBuilder,
succeedState: succeedBuilder,
),
);