StatefulCell<T> class abstract

A cell with the state managed by a CellState object.

This class should be subclassed if you need to create a cell type that manages its own observers or stores its own value. The state of the cell, the observers and its value, should be stored in the CellState object rather than the StatefulCell. This is to allow multiple ValueCell objects with the same key to reference the same CellState, and hence share the same state.

NOTE:

The CellState only exists while it has at least one observer. If the CellState has no observers then effectively this cell has no state, it is inactive. Inactive cells should handle accesses to their values as gracefully as possible. For example an computed cell will simply recompute its value whenever it is accessed while it is inactive.

Inheritance
Implementers
Available extensions

Constructors

StatefulCell({dynamic key})
Create a cell identified by key.

Properties

asyncState ValueCell<AsyncState<T>>

Available on FutureCell<T>, provided by the WaitCellExtension extension

A cell that evaluates to the AsyncState of the Future in this cell.
no setter
awaited ValueCell<T>

Available on FutureCell<T>, provided by the WaitCellExtension extension

A cell that awaits the Future held in this.
no setter
cellList ValueCell<Iterable<ValueCell<T>>>

Available on ValueCell<List<T>>, provided by the ListCellExtension extension

Returns a cell which wraps the elements of the List held in this cell in ValueCells.
no setter
effectCell ValueCell<T>

Available on ValueCell<T>, provided by the EffectCellExtension extension

Create a cell for observing side effects defined in this cell.
no setter
entries ValueCell<Iterable<MapEntry<K, V>>>

Available on ValueCell<Map<K, V>>, provided by the MapCellExtension extension

Returns a cell which evaluates to Map.entries applied on the value in this cell.
no setter
equalityCellFactory EqualityCellFactory
Return a factory for creating equality and inequality comparison cells.
no setterinherited
error ValueCell

Available on ValueCell<Maybe<T>>, provided by the MaybeCellExtension extension

A cell which evaluates to the error of the Maybe.
no setter
first ValueCell<T>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.first applied on the value in this cell.
no setter
hashCode int
The hash code for this object.
no setteroverride
hasState bool
Does this cell have a state?
no setter
inDays ValueCell<int>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

The duration in units of days, see Duration.inDays
no setter
inHours ValueCell<int>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

The duration in units of hours, see Duration.inHours
no setter
inMicroseconds ValueCell<int>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

The duration in units of microseconds, see Duration.inMicroseconds
no setter
inMilliseconds ValueCell<int>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

The duration in units of milliseconds, see Duration.inMilliseconds
no setter
inMinutes ValueCell<int>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

The duration in units of minutes, see Duration.inMinutes
no setter
inSeconds ValueCell<int>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

The duration in units of seconds, see Duration.inSeconds
no setter
isCompleted ValueCell<bool>

Available on FutureCell<T>, provided by the WaitCellExtension extension

A cell that is true when the Future in this has completed, false otherwise.
no setter
isEmpty ValueCell<bool>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.isEmpty applied on the value in this cell.
no setter
isEmpty ValueCell<bool>

Available on ValueCell<Map<K, V>>, provided by the MapCellExtension extension

Returns a cell which evaluates to Map.isEmpty applied on the value in this cell
no setter
isFinite ValueCell<bool>

Available on ValueCell<num>, provided by the NumericExtension extension

no setter
isInfinite ValueCell<bool>

Available on ValueCell<num>, provided by the NumericExtension extension

no setter
isNaN ValueCell<bool>

Available on ValueCell<num>, provided by the NumericExtension extension

no setter
isNegative ValueCell<bool>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell, the value of which is true if this is negative, see Duration.isNegative.
no setter
isNotEmpty ValueCell<bool>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.isNotEmpty applied on the value in this cell.
no setter
isNotEmpty ValueCell<bool>

Available on ValueCell<Map<K, V>>, provided by the MapCellExtension extension

Returns a cell which evaluates to Map.isNotEmpty applied on the value in this cell
no setter
key ↔ dynamic
Key which uniquely identifies the cell
latefinal
keys ValueCell<Iterable<K>>

Available on ValueCell<Map<K, V>>, provided by the MapCellExtension extension

Returns a cell which evaluates to Map.keys applied on the value in this cell.
no setter
last ValueCell<T>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.last applied on the value in this cell.
no setter
length ValueCell<int>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.length applied on the value in this cell.
no setter
length ValueCell<int>

Available on ValueCell<Map<K, V>>, provided by the MapCellExtension extension

Returns a cell which evaluates to Map.length applied on the value in this cell
no setter
notNull ValueCell<T>

Available on ValueCell<T?>, provided by the NullCheckExtension extension

A cell that is guaranteed to hold a non-null value.
no setter
peek ValueCell<T>

Available on ValueCell<T>, provided by the PeekCellExtension extension

Use the value of this without reacting to changes.
no setter
previous ValueCell<T>

Available on ValueCell<T>, provided by the PrevValueCellExtension extension

Return a cell which holds the previous value of this cell.
no setter
reversed ValueCell<Iterable<T>>

Available on ValueCell<List<T>>, provided by the ListCellExtension extension

Returns a cell which evaluates to List.reversed applied on the value in this cell.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sign ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension

no setter
single ValueCell<T>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.single applied on the value in this cell.
no setter
state CellState<StatefulCell>?
The current state of the cell, or null if the cell is inactive.
no setter
unwrap ValueCell

Available on ValueCell<Maybe<T>>, provided by the MaybeCellExtension extension

A cell which evaluates to the unwrapped value (by Maybe.unwrap) of the Maybe.
no setter
value → T
The cell's value
no setterinherited
values ValueCell<Iterable<V>>

Available on ValueCell<Map<K, V>>, provided by the MapCellExtension extension

Returns a cell which evaluates to Map.values applied on the value in this cell.
no setter
wait ValueCell<T>

Available on FutureCell<T>, provided by the WaitCellExtension extension

Return a cell that awaits the Future held in this.
no setter
waitLast ValueCell<T>

Available on FutureCell<T>, provided by the WaitCellExtension extension

A cell that awaits the Future held in this.
no setter
whenReady ValueCell<T>

Available on ValueCell<T>, provided by the ErrorCellExtension extension

Create a cell that evaluates to ValueCell.none() while the cell's value is uninitialized.
no setter

Methods

abs() ValueCell<Duration>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell holding a Duration of the same length as this but positive, see Duration.abs.
abs() ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension

addObserver(CellObserver observer) → void
Register an observer of the cell to be called when the cell's value changes.
override
and(ValueCell<bool> other) ValueCell<bool>

Available on ValueCell<bool>, provided by the BoolCellExtension extension

Create a new cell which is the logical and of this and other.
apply<U>(U fn(T value), {dynamic key}) ValueCell<U>

Available on ValueCell<T>, provided by the ComputeExtension extension

Create a new cell, with a value which is computed by applying a function on this cell's value
call() → T
Retrieve the value of the cell.
inherited
cast<R>() ValueCell<Iterable<R>>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.cast<R>() applied on the value in this cell.
cast<R>() ValueCell<List<R>>

Available on ValueCell<List<T>>, provided by the ListCellExtension extension

Returns a cell which evaluates to List.cast<R>() applied on the value in this cell.
chain(void action(), {dynamic key}) ActionCell

Available on ValueCell<void>, provided by the ActionCellExtension extension

Create an action cell that is chained to this cell.
coalesce(ValueCell<T> ifNull) ValueCell<T>

Available on ValueCell<T?>, provided by the NullCheckExtension extension

Replace null values in this cell with value of another cell.
contains(ValueCell elem) ValueCell<bool>

Available on ValueCell<Set<T>>, provided by the SetCellExtension extension

Returns a cell that evaluates to true if the Set contains elem.
containsAll(ValueCell<Iterable> elems) ValueCell<bool>

Available on ValueCell<Set<T>>, provided by the SetCellExtension extension

Returns a cell that evaluates to true if the Set contains elems.
containsKey(ValueCell key) ValueCell<bool>

Available on ValueCell<Map<K, V>>, provided by the MapCellExtension extension

Returns a cell which evaluates to true if the Map held in this cell contains the key key.
containsValue(ValueCell val) ValueCell<bool>

Available on ValueCell<Map<K, V>>, provided by the MapCellExtension extension

Returns a cell which evaluates to true if the Map held in this cell contains the value val.
createState() CellState<StatefulCell>
Create the CellState for this cell.
delayed(Duration delay) FutureCell<T>

Available on ValueCell<T>, provided by the DelayCellExtension extension

Create a cell which notifies its observers, for value changes in this, after a delay.
effect<T>(T fn(), {dynamic key}) ValueCell<T>

Available on ValueCell<void>, provided by the ActionCellEffectExtension extension

Create a cell with a side effect that is run whenever this cell is triggered..
eq<U>(ValueCell<U> other) ValueCell<bool>
Returns a new ValueCell which compares the value of this cell to another cell for equality.
inherited
error<E extends Object>({bool all = false}) ValueCell<E?>

Available on ValueCell<T>, provided by the ErrorCellExtension extension

Create a cell which captures exceptions thrown during the computation of this cell.
hold() CellHolder

Available on ValueCell, provided by the CellHolderExtension extension

Ensure that this cell is active.
initialValue(ValueCell<T> value) ValueCell<T>

Available on ValueCell<T>, provided by the ErrorCellExtension extension

Returns a cell that evaluates to the value of value when the value of this is uninitialized.
loadingValue(ValueCell<T> value) ValueCell<T>

Available on ValueCell<T>, provided by the ErrorCellExtension extension

Returns a cell that evaluates to the value of value while an async value is loading..
map<E>(E toElement(T e)) ValueCell<Iterable<E>>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.map() applied on the value in this cell.
mapCells<E>(E fn(T e)) ValueCell<Iterable<ValueCell<E>>>

Available on ValueCell<List<T>>, provided by the ListCellExtension extension

Apply a function on the value of every cell in cellList.
mutableApply<U>(U fn(T), void reverse(U), {dynamic key, bool changesOnly = false}) MutableCell<U>

Available on ValueCell<T>, provided by the ComputeExtension extension

Create a new mutable cell, with a value that is a function of this cell's value.
neq<U>(ValueCell<U> other) ValueCell<bool>
Returns a new ValueCell which compares the value of this cell to another cell for inequality.
inherited
nextValue() Future<T>

Available on ValueCell<T>, provided by the ValueChangeExtension extension

Returns a Future that completes with the next value of this cell, when it is updated.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
not() ValueCell<bool>

Available on ValueCell<bool>, provided by the BoolCellExtension extension

Create a new cell which is the logical not of this.
observe() → void
Track this cell as an argument of the current compute/watch function.
inherited
onError<E extends Object>(ValueCell<T> other) ValueCell<T>

Available on ValueCell<T>, provided by the ErrorCellExtension extension

Create a cell which handles exceptions thrown while computing the value of this.
or(ValueCell<bool> other) ValueCell<bool>

Available on ValueCell<bool>, provided by the BoolCellExtension extension

Create a new cell which is the logical or of this and other.
remainder(ValueCell<num> other) ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension

removeObserver(CellObserver observer) → void
Remove an observer that was previously registered with addObserver.
override
select<T>(ValueCell<T> ifTrue, [ValueCell<T>? ifFalse]) ValueCell<T>

Available on ValueCell<bool>, provided by the BoolCellExtension extension

Create a new cell which selects between the values of two cells based on this.
store({bool changesOnly = false}) StoreCell<T>

Available on ValueCell<T>, provided by the StoreCellExtension extension

Return a ValueCell which stores the value of this cell in memory.
toList() ValueCell<List<T>>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.toList applied on the value in this cell.
toSet() ValueCell<Set<T>>

Available on ValueCell<Iterable<T>>, provided by the IterableCellExtension extension

Returns a cell which evaluates to Iterable.toSet applied on the value in this cell.
toString() String
A string representation of this object.
inherited
transform<U extends T>() ValueCell<U>

Available on ValueCell<T>, provided by the TransformExtension extension

untilFalse() Future<void>

Available on ValueCell<bool>, provided by the BoolValueChangeExtension extension

Returns a Future that completes when the value of this cell is false.
untilTrue() Future<void>

Available on ValueCell<bool>, provided by the BoolValueChangeExtension extension

Returns a Future that completes when the value of this cell is true.
untilValue<U>(U value) Future<void>

Available on ValueCell<T>, provided by the ValueChangeExtension extension

Returns a Future that completes when the value of this cell equals value.

Operators

operator %(ValueCell<num> other) ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension

operator *(ValueCell<num> factor) ValueCell<Duration>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell which holds the multiplication of this by factor.
operator *(ValueCell<num> other) ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension

operator +(ValueCell<Duration> other) ValueCell<Duration>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell which holds the sum of this and other.
operator +(ValueCell<num> other) ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension

operator -(ValueCell<Duration> other) ValueCell<Duration>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell which holds the subtraction of other from this.
operator -(ValueCell<num> other) ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension

operator /(ValueCell<num> other) ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension

operator <(ValueCell<Duration> other) ValueCell<bool>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell of which the value is true if this is less than other
operator <(ValueCell<num> other) ValueCell<bool>

Available on ValueCell<num>, provided by the NumericExtension extension

operator <=(ValueCell<Duration> other) ValueCell<bool>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell of which the value is true if this is less than or equal to other
operator <=(ValueCell<num> other) ValueCell<bool>

Available on ValueCell<num>, provided by the NumericExtension extension

operator ==(Object other) bool
The equality operator.
override
operator >(ValueCell<Duration> other) ValueCell<bool>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell of which the value is true if this is greater than other
operator >(ValueCell<num> other) ValueCell<bool>

Available on ValueCell<num>, provided by the NumericExtension extension

operator >=(ValueCell<Duration> other) ValueCell<bool>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell of which the value is true if this is greater than or equal to other
operator >=(ValueCell<num> other) ValueCell<bool>

Available on ValueCell<num>, provided by the NumericExtension extension

operator [](ValueCell<int> index) ValueCell<T>

Available on ValueCell<List<T>>, provided by the ListCellExtension extension

Returns a cell with a value equal to the element at index in the List held in this cell.
operator [](ValueCell key) ValueCell<V?>

Available on ValueCell<Map<K, V>>, provided by the MapCellExtension extension

Returns a cell which evaluates to the value of the entry with key key.
operator unary-() ValueCell<Duration>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell which holds the negation of this.
operator unary-() ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension

operator ~/(ValueCell<int> quotient) ValueCell<Duration>

Available on ValueCell<Duration>, provided by the DurationCellExtension extension

Returns a cell which holds the division of this by quotient.
operator ~/(ValueCell<num> arg) ValueCell<num>

Available on ValueCell<num>, provided by the NumericExtension extension