BlocConsumer<B extends BlocBase<S> , S extends Object> constructor
const
BlocConsumer<B extends BlocBase<S> , S extends Object> ({
- required BlocWidgetListener<
S> listener, - required BlocWidgetBuilder<
S> builder, - Key? key,
- B? bloc,
- BlocListenerCondition<
S> ? listenWhen, - BlocBuilderCondition<
S> ? buildWhen,
The BlocConsumer constuctor listen and rebuilds a widget
when a bloc
state change.
Implementation
const BlocConsumer({
required BlocWidgetListener<S> listener,
required this.builder,
Key? key,
/// The [bloc] that the [BlocConsumer] will interact with.
/// If omitted, [BlocConsumer] will automatically perform a lookup using
/// `BlocProvider` and the current `BuildContext`.
B? bloc,
BlocListenerCondition<S>? listenWhen,
this.buildWhen,
}) : super(
key: key,
bloc: bloc,
listenWhen: listenWhen,
listener: listener,
);