ValueListenableBuilder<T> class

A widget whose content stays synced with a ValueListenable.

Given a ValueListenable<T> and a builder which builds widgets from concrete values of T, this class will automatically register itself as a listener of the ValueListenable and call the builder with updated values when the value changes.

See also:

Inheritance

Constructors

ValueListenableBuilder({Key? key, required ValueListenable<T> valueListenable, required ValueWidgetBuilder<T> builder, Widget? child})
Creates a ValueListenableBuilder.
const

Properties

builder ValueWidgetBuilder<T>
A ValueWidgetBuilder which builds a widget depending on the valueListenable's value.
final
child Widget?
A valueListenable-independent widget which is passed back to the builder.
final
correspondingTag DomTagType?
Corresponding HTML tag to use to render this widget
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
key Key?
Keys help Rad identify which widgets have changed, are added, or are removed when a widget has multiple sibling widgets.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
valueListenable ValueListenable<T>
The ValueListenable whose value you depend on in order to build.
final
widgetCaptureEventListeners Map<DomEventType, EventCallback?>
Events that this widget is listening to in capturing phase.
no setterinherited
widgetEventListeners Map<DomEventType, EventCallback?>
Events that this widget is listening to in bubbling phase.
no setterinherited

Methods

createRenderElement(RenderElement parent) RenderElement
Create element for current widget.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldUpdateWidget(Widget oldWidget) bool
Whether to update current widget.
inherited
shouldUpdateWidgetChildren(Widget oldWidget, bool shouldUpdateWidget) bool
Whether to update current widget's children.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited