listenWhen<TState> method
Null safety
- bool condition(
- TState prev,
- TState next
- void listener(
- BuildContext context,
- TCubit cubix
- Widget child,
- {Object? family,
- bool transient = false}
Implementation
Widget listenWhen<TState>(
bool Function(TState prev, TState next) condition,
void Function(BuildContext context, TCubit cubix) listener,
Widget child, {
Object? family,
/// remove cubix automatically when the widget is disposed
bool transient = false,
}) {
return CubixListener<TCubit>(
create: this,
listenWhen: (prev, next) => condition(prev as TState, next as TState),
listener: listener,
child: child,
family: family,
transient: transient,
);
}