indexed_iterable 1.0.2+1 copy "indexed_iterable: ^1.0.2+1" to clipboard
indexed_iterable: ^1.0.2+1 copied to clipboard

outdated

A simple delegate representing `Iterable`, like `List` and `set`, with index.

Simple delegate for Indexed Itrables #

This simple package offers a delegates to represent an Iterable, like List and set, to be use in a range-based for loop with an index.

Usage #

If a class to use this package is based on Iterable class, then you can use this package as follows.

import 'package:indexed_iterable/indexed_iterable.dart';

void main() {
  final testList = [1,2,3,4,2,2,3,4];
  for(final ii in IndexedIterable(testList)) {
    print(ii.index);
    print(ii.value);
  }
}

Instead of IndexedIterable constructor, you can use II(testList), toII(testList) functions, testList.ii, testList.II, testList.indexedIterable extended getter and testList.toII(), testList.toIndexedIterable() extended function. See the example and API docs.

1
likes
0
pub points
0%
popularity

Publisher

verified publishergihwan.com

A simple delegate representing `Iterable`, like `List` and `set`, with index.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on indexed_iterable