cycle method
Lazy infinite iterable repeating this list.
Implementation
Iterable<T> cycle() sync* {
if (isEmpty) return;
int i = 0;
while (true) {
yield this[i % length];
i++;
}
}
Lazy infinite iterable repeating this list.
Iterable<T> cycle() sync* {
if (isEmpty) return;
int i = 0;
while (true) {
yield this[i % length];
i++;
}
}