splitAt method
Splits into two lists at index. First list has elements [0..index), second index..length.
Implementation
@useResult
(List<T>, List<T>) splitAt(int index) {
final List<T> list = toList();
if (index <= 0) return (<T>[], list);
if (index >= list.length) return (list, <T>[]);
return (list.sublist(0, index), list.sublist(index));
}