A reactive computed value that derives from other signals.
Computed values automatically recalculate when their dependencies change. They are lazily evaluated, meaning they only recompute when accessed and their dependencies have changed.
Computed values are read-only and cannot be directly set.
Example:
final count = signal(2);
final doubled = computed((prev) => count() * 2);
print(doubled()); // prints: 4
count(3);
print(doubled()); // prints: 6
- Implemented types
-
- Signal<
T>
- Signal<
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call(
) → T -
Reads the current value of the signal.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited