splitAtList<T> function
Split iterable into two.
Implementation
List<List<T>> splitAtList<T>(int n, Iterable<T> it) {
List<T> l = List.from(it);
if (n <= 0) {
return [[], l];
}
if (n >= l.length) {
return [l, []];
}
return [l.sublist(0, n), l.sublist(n, l.length)];
}