CellState<T extends StatefulCell> class
Holds the state of a StatefulCell.
The cell state is responsible for keeping track of the observers of the cell and whatever is necessary for computing the cell's value
- Implementers
Constructors
- CellState({required T cell, required dynamic key})
-
Create a state for
cell
identified bykey
.
Properties
- cell → T
-
The cell associated with this state
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isActive → bool
-
Does this cell have at least one observer?
no setter
- isDisposed → bool
-
Has this state been disposed.
no setter
- key → dynamic
-
The key identifying the cell.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addObserver(
CellObserver observer) → void - Add an observer which is notified of changes in the value of the cell.
-
dispose(
) → void - Teardown the cell state.
-
init(
) → void - Initialize the cell state.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyUpdate(
{bool isEqual = false, bool didChange = true}) → void - Notify the observers of the cell that the cell's value has changed.
-
notifyWillUpdate(
{bool isEqual = false}) → void - Notify the observers of the cell that the cell's value will change.
-
removeObserver(
CellObserver observer) → void - Remove an observer, so that it is no longer notified of changes in the value of the cell.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getState<
T extends CellState< (StatefulCell> >dynamic key, T create()) → T -
Get the state for the cell identified by
key
. -
maybeGetState<
T extends CellState< (StatefulCell> >dynamic key) → T? -
Get the state for the cell identified by
key
if it exists.