index method

Iterable<T> index(
  1. T callback(
    1. T item,
    2. int index
    )
)

Index and loop it through callback.

Implementation

Iterable<T> index(T Function(T item, int index) callback) {
  int i = 0;
  for (final tmp in this) {
    callback(tmp, i);
    i++;
  }
  return this;
}