Skip to content

NotifierBuilder

Builds a subtree when notifier publishes a change.

Learn more: State management

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

NotifierBuilder(
notifier: cart,
builder: (context, cart) => Text('Items: ${cart.itemCount}'),
)

The builder receives the original, typed notifier and a context belonging to this widget. Additional context.listen or context.scope calls inside the builder also rebuild this widget, rather than its parent.

Subscriptions follow the sources used by each build and are removed when this widget unmounts. The source remains owned by its caller and is never disposed by this widget. Any Listenable is supported, including Notifier, ValueNotifier, animations, and custom subscription sources.

ParameterTypeDefaultDescription
notifier:TrequiredThe model or other subscription source to observe.
builder:Widget Function(BuildContext context, T notifier)requiredBuilds from the current state of notifier whenever it notifies.

NotifierBuilder is defined in packages/fleury/lib/src/widgets/notifier_builder.dart.

Category: State & async · All widgets