split<T> static method
Implementation
static List<List<T>> split<T>(List<T> list, int n) {
var out = <List<T>>[];
var i = 0;
while (i < list.length) {
var end = (i + n < list.length) ? i + n : list.length;
out.add(list.sublist(i, end));
i += n;
}
return out;
}