trimToSublist method

void trimToSublist(
  1. int start, [
  2. int? end
])

Truncates to just the elements between start and end.

If end is omitted, it defaults to the length of this list.

The start and end positions must satisfy the relations 0 ≤ startendlength If end is equal to start, then the returned list is empty.

Implementation

void trimToSublist(int start, [int? end]) {
  // TODO(jacobr): use a more sophisticated data structure such as
  // https://en.wikipedia.org/wiki/Rope_(data_structure) to make the
  // implementation of this method more efficient.
  _rawList = _rawList.sublist(start, end);
  _listChanged();
}