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}'),)Details
Section titled “Details”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.
Constructors
Section titled “Constructors”NotifierBuilder()
Section titled “NotifierBuilder()”| Parameter | Type | Default | Description |
|---|---|---|---|
notifier: | T | required | The model or other subscription source to observe. |
builder: | Widget Function(BuildContext context, T notifier) | required | Builds from the current state of notifier whenever it notifies. |
Source
Section titled “Source”NotifierBuilder is defined in packages/fleury/lib/src/widgets/notifier_builder.dart.
Category: State & async · All widgets