indexed method

Iterable<MapEntry<int, T>> indexed({
  1. int initial = 0,
})

Returns an Iterable that indexes each element, start from initial.

Implementation

Iterable<MapEntry<int, T>> indexed({int initial = 0}) sync* {
  for (final element in this) {
    yield MapEntry(initial++, element);
  }
}