clearAndAddAll method

void clearAndAddAll(
  1. List<T> items
)

Clear and add all elements of List items to the list.

Implementation

void clearAndAddAll(List<T> items) {
  if (isEmpty && items.isEmpty) return;
  clear();
  addAll(items);
}