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

equalityCellFactory EqualityCellFactory
Return a factory for creating equality and inequality comparison cells.
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
hasState bool
Does this cell have a state?
no setter
key ↔ dynamic
Key which uniquely identifies the cell
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state CellState<StatefulCell>?
The current state of the cell, or null if the cell is inactive.
no setter
value → T
The cell's value
no setterinherited

Methods

addObserver(CellObserver observer) → void
Register an observer of the cell to be called when the cell's value changes.
override
call() → T
Retrieve the value of the cell.
inherited
createState() CellState<StatefulCell>
Create the CellState for this cell.
eq<U>(ValueCell<U> other) ValueCell<bool>
Returns a new ValueCell which compares the value of this cell to another cell for equality.
inherited
neq<U>(ValueCell<U> other) ValueCell<bool>
Returns a new ValueCell which compares the value of this cell to another cell for inequality.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe() → void
Track this cell as an argument of the current compute/watch function.
inherited
removeObserver(CellObserver observer) → void
Remove an observer that was previously registered with addObserver.
override
toString() String
A string representation of this object.
inherited

Operators

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