value property

T get value
inherited

Gets the current value and establishes a reactive dependency.

When accessed within a reactive context, the context will be notified when this value changes.

Example:

final Readonly<int> readonly = Signal(0).readonly();
final computed = Computed(() => readonly.value * 2);

Implementation

T get value;
set value (T value)

Sets a new value for this reactive value.

This will notify all subscribers if the value has changed.

Example:

final Writable<int> writable = Signal(0);
writable.value = newValue; // Notifies subscribers

Implementation

set value(T value);