MutableDependentCell<T> class abstract

Base class for a computational cell which can have its value set.

The use of this class is similar to DependentCell however the compute method, rather than the value property setter, has to be overriden with the implementation of the cell computation function.

Constructors of this class must call the MutableDependentCell constructor with the list of argument cells which are referenced in the compute function. The value of the cell will be recomputed whenever the value of one of the argument cells changes.

Additionally, subclasses must also implement the reverseCompute method, which is called whenever the value of the cell is set. This method should update the values of the argument cells.

Inheritance
Implemented types
Implementers
Available extensions

Constructors

MutableDependentCell(Set<ValueCell> arguments, {bool changesOnly = false, dynamic key})
Construct a MutableDependentCell which depends on the cells in arguments

Properties

arguments Set<ValueCell>
List of argument cells.
final
changesOnly bool
Should the cell notify its observers only when its value has changed?
final
equalityCellFactory EqualityCellFactory
Return a factory for creating equality and inequality comparison cells.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasState bool
Does this cell have a state?
no setterinherited
key ↔ dynamic
Key which uniquely identifies the cell
latefinalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → MutableComputedCellState<T, MutableDependentCell<T>>
The current state of the cell, or null if the cell is inactive.
no setter
value ↔ T
The cell's value
getter/setter pairinherited

Methods

addObserver(CellObserver observer) → void
Register an observer of the cell to be called when the cell's value changes.
inherited
call() → T
Retrieve the value of the cell.
inherited
compute() → T
Compute the value of the cell.
createMutableState({covariant MutableComputedCellState<T, MutableDependentCell<T>>? oldState}) → MutableComputedCellState<T, MutableDependentCell<T>>
Create the state for the MutableCell.
createState() → MutableCellState<T, MutableCellBase<T>>
Create the CellState for this cell.
inherited
dumpState(CellValueCoder coder) Object?
Dump the state of the cell to a value.
override
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.
inherited
restoreState(Object? state, CellValueCoder coder) → void
Restore the state of the cell.
override
reverseCompute(T value) → void
Set the value of the argument cells in response to the value of the cell being set.
toString() String
A string representation of this object.
inherited

Operators

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