splitAt method

(List<T>, List<T>) splitAt(
  1. int index
)

Splits the list at the specified index

Implementation

(List<T>, List<T>) splitAt(int index) {
  if (index < 0 || index > length) {
    throw RangeError('Index $index out of bounds');
  }
  return (sublist(0, index), sublist(index));
}