slice method

*<Null safety>*

ListSlice<E> slice (int start, [int? end])

Implementation

ListSlice<E> slice(int start, [int? end]) {
  end = RangeError.checkValidRange(start, end, length);
  var self = this;
  if (self is ListSlice) return self.slice(start, end);
  return ListSlice<E>(this, start, end);
}