length property

MutableCell<int> get length

Returns a cell which evaluates to List.length applied on the value in this cell.

Changing the value of the returned cell changes the length of the List held in this cell.

NOTE: The actual list is not modified but a new list is created.

Implementation

MutableCell<int> get length => mutableApply((value) => value.length,
    (v) => value = _updateListLength(value, v),
    changesOnly: true,
    key: _MutableListPropKey(this, #length)
);