buildWhen property

ShouldProceedCallback<S>? buildWhen
finalinherited

Function to determine if the widget should rebuild when state changes.

If provided, this function is called with the previous and current state. Return true to rebuild, false to skip rebuilding.

Example:

NotifierBuilder<CounterNotifier, int>(
  buildWhen: (previous, current) => current % 2 == 0, // Only rebuild for even numbers
  builder: (context, count, child) => Text('Even count: $count'),
)

Implementation

final ShouldProceedCallback<S>? buildWhen;