clear method

  1. @override
void clear ()

Removes all objects from this list; the length of the list becomes zero.

Throws an UnsupportedError, and retains all objects, if this is a fixed-length list.

Implementation

@override
void clear() {
  _context.conditionallyRunInAction(() {
    final oldItems = _list.toList(growable: false);
    _list.clear();
    _notifyListUpdate(0, null, oldItems);
  }, _atom);
}