applyForIndexed<T> method
Repeat the task
with T
as parameter for n
times
Implementation
T applyForIndexed<T>(int n, T Function(T v, int i) task) {
T value = this as T;
n.repeatsForIndexed((i) => value = task(value, i));
return value;
}