Computed<T> class
A computed reactive value.
Computed values are:
- Lazy: Only computed when accessed
- Cached: Reuses the last value if dependencies haven't changed
- Reactive: Tracks its own dependents and notifies them when it changes
- Available extensions
Constructors
- Computed(T _getter())
- Creates a new computed value with the given getter function.
Properties
Methods
-
asReadonly(
) → Readonly< T> -
Available on Computed<
Create a readonly view of this computed.T> , provided by the ReadonlyComputed extension -
call(
) → T - Makes Computed callable, returning the reactive value.
-
invalidate(
) → void - Force the computed to recalculate on next access.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
watch(
BuildContext context) → T -
Available on Computed<
Watch this computed's value and rebuild only this widget when it changes.T> , provided by the ComputedWatchExtension extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited