FlameBlocListener<B extends BlocBase<S> , S> constructor
FlameBlocListener<B extends BlocBase<S> , S> ({
- required void onNewState(
- S state
- void onInitialState(
- S state
- B? bloc,
- bool listenWhen(
- S previousState,
- S newState
- ComponentKey? key,
A Component
which can listen to changes in a Bloc
state.
Implementation
FlameBlocListener({
required void Function(S state) onNewState,
void Function(S state)? onInitialState,
B? bloc,
bool Function(S previousState, S newState)? listenWhen,
super.key,
}) : _onNewState = onNewState,
_onInitialState = onInitialState,
_listenWhen = listenWhen {
if (bloc != null) {
this.bloc = bloc;
}
}