HandyList<T> extension
- on
-
- Iterable<
T>
- Iterable<
Methods
-
inBetween(
T between(int index), {bool outer = false}) → Iterable< T> -
Returns a new iterable where new elements are inserted between the elements of the current iterable.
Example:
0, 2, 4, 6, 8, 10
.inBetween((index) => index) ==0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
If you setouter
to true, it will add an element at the beginning and end of the list too. Example:1, 3, 5, 7, 9
.inBetween((index) => index, outer: true) ==0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10