buildWhen property

bool Function()? buildWhen
final

Optional condition to determine whether the widget should rebuild.

If provided, the widget will only rebuild when this function returns true. The function is called whenever any reactive variable changes.

Example:

buildWhen: () => age.value >= 18,  // Only rebuild when adult
buildWhen: () => items.value.isNotEmpty,  // Only rebuild when has items

Implementation

final bool Function()? buildWhen;