PropsReadonlyNode<T extends SetupWidget<T> > class
A reactive node that tracks widget property changes.
This node allows reactive code (like useComputed or useEffect) to depend on widget properties. When the widget is updated with new properties, this node notifies all its subscribers to re-run.
The node's value is the current widget instance, so you can access any property of the widget reactively.
Example:
class UserCard extends SetupWidget<UserCard> {
final String name;
final int age;
const UserCard({super.key, required this.name, required this.age});
@override
setup(context, props) {
// React to name changes
final displayName = useComputed(() => 'User: ${props.value.name}');
return () => Text(displayName.value);
}
}
- Inheritance
-
- Object
- ReactiveNode
- CustomReactiveNode
- PropsReadonlyNode
- Implemented types
-
- ReadonlyNode<
T>
- ReadonlyNode<
Constructors
- PropsReadonlyNode(BuildContext _context)
Properties
- deps ↔ Link?
-
First dependency link in the chain.
getter/setter pairinherited
- depsTail ↔ Link?
-
Last dependency link in the chain.
getter/setter pairinherited
- flags ↔ int
-
Reactive flags for this node.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether this node has been disposed.
no setteroverride
- peek → T
-
Gets the current value without establishing a reactive dependency.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subs ↔ Link?
-
First subscriber link in the chain.
getter/setter pairinherited
- subsTail ↔ Link?
-
Last subscriber link in the chain.
getter/setter pairinherited
- value → T
-
Gets the current value and establishes a reactive dependency.
no setteroverride
Methods
-
call(
) → T -
dispose(
) → FutureOr< void> - Dispose this object and clean up its resources.
-
get(
) → T -
Gets the current value and establishes a reactive dependency.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → void -
Manually notifies all subscribers that this value has changed.
override
-
onDispose(
) → void -
Called when the node is being disposed.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updateNode(
) → bool -
Updates the node and reports whether its value changed.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited