value property
Gets the current value and establishes a reactive dependency.
When accessed within a reactive context (Effect, Computed, etc.), the context will be notified when this value changes.
Example:
final count = Signal(0);
final doubled = Computed(() => count.value * 2);
Implementation
@override
T get value {
return delegated.source.value;
}
Sets a new value and notifies subscribers if changed.
Automatically notifies all subscribers when the value changes.
Example:
final count = Signal(0);
count.value = 10; // Notifies subscribers
Implementation
@override
set value(T value) {
assert(!isDisposed, "$runtimeType is disposed");
if (!isDisposed) {
delegated.source.value = value;
}
}