buildWhen<TState> method
Null safety
- bool condition(
- TState prev,
- TState next
- Widget builder(
- BuildContext context,
- TCubit cubix
- {Object? family,
- bool transient = false}
Implementation
Widget buildWhen<TState>(
bool Function(TState prev, TState next) condition,
Widget Function(BuildContext context, TCubit cubix) builder, {
Object? family,
/// remove cubix automatically when the widget is disposed
bool transient = false,
}) {
return CubixBuilder<TCubit>(
create: this,
buildWhen: (prev, next) => condition(
(prev as CubixState<TState>).state,
(next as CubixState<TState>).state,
),
builder: builder,
family: family,
transient: transient,
);
}