WritableState<T> class final

Data that allows the user both direct read and write accesss to its value.

Implemented types

Constructors

WritableState([T? value])
The initial value of the data.

Properties

$ ValueStream<T>
The value of the data as a ValueStream.
latefinal
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ↔ T
The value of the data to remember.
getter/setter pairoverride-getter

Methods

call() → T
Read the value of the data.
override
mutate(void mutator(T)) → void
Change the value of the data without replacing the previous state with the new state. This method must not be used for data that is immutable such as primitive data types (for example: Strings, nums, bools, etc.).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(T value) → void
Set the value of the data. The new value must be of the same type as the previous value.
toString() String
A string representation of this object.
inherited
update(T derivation(T)) → void
update the data with a new value by deriving it from the previous value. The new value of the data is considered to be a different object compared to the previous value; if it is important that both of them must stay as the same object, consider to mutate the value instead.

Operators

operator ==(Object other) bool
The equality operator.
inherited