filterWithIndex method

Iterable<T> filterWithIndex(
  1. bool test(
    1. T t,
    2. int index
    )
)

Returns the list of those elements that satisfy test.

Implementation

Iterable<T> filterWithIndex(bool Function(T t, int index) test) sync* {
  var index = 0;
  for (var value in this) {
    if (test(value, index)) {
      yield value;
    }
    index += 1;
  }
}