Computed<T> class

A reactive value that automatically recalculates whenever its dependencies change.

The Computed class tracks reactive dependencies accessed during the computation function and updates its value when any of those dependencies change.

Example:

final computedValue = Computed(() => someReactiveValue + 10);
print(computedValue.value);

Constructors

Computed(T compute())
Creates a Computed instance with the given computation function compute.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The current value of this computed property. Accessing this getter returns the latest computed value.
no setter

Methods

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