A reactive signal that can be both read and written.
WritableSignal extends Signal to provide write capabilities. It allows updating the signal's value, which will trigger updates to all dependent computations and effects.
Example:
final count = signal(0);
count.set(5); // sets value to 5
print(count()); // prints: 5
- Implemented types
-
- Signal<
T>
- Signal<
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
-
set(
T value) → void - Sets the value of this writable signal.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited