method removeRange


void removeRange(int start, int end)

Removes the objects in the range start inclusive to end exclusive.

The start and end indices must be in the range 0 ≤ index ≤ length, and start ≤ end.

Throws an UnsupportedError if this is a fixed-length list. In that case the list is not modified.

Source

void removeRange(int start, int end) {
  _rangeCheck(start, end);
  int rangeLength = end - start;
  int len = _list.length;

  _notifyChangeLength(len, len - rangeLength);
  if (hasListObservers && rangeLength > 0) {
    _recordChange(new ListChangeRecord(this, start,
        removed: _list.getRange(start, end).toList()));
  }

  _list.removeRange(start, end);
}