clear method Null safety

void clear()

Removes all items from the list.

Implementation

void clear() {
  _isDirty = false;
  _list.clear();
  _set.clear();
}