intersperseList<T> function
Insert an element between other elements
Implementation
List<T> intersperseList<T>(T v, Iterable<T> it) {
List<T> l = List.from(it);
if (l.length <= 1) {
return l;
}
List<T> result = [l.first];
for (int i = 1; i < l.length; i++) {
result
..add(v)
..add(l[i]);
}
return result;
}