slice method
return sublist of range [from,to)
example
[a,b,c,d,e,f,g,h,i,j,k].slice(3,6) // => [d,e,f]
Implementation
Iterable<T> slice(int from, [int? to]) {
if (to == null) {
return skip(from);
} else {
return skip(from).take(to - from);
}
}