whereIndexed method

Iterable<ListIndex<T>> whereIndexed([
  1. bool filter(
    1. T item
    )?
])

Implementation

Iterable<ListIndex<T>> whereIndexed([bool filter(T item)?]) {
  Iterable<ListIndex<T>> indexed = this != null
      ? this!.indexed() as Iterable<ListIndex<T>>
      : <ListIndex<T>>[];
  if (filter != null) {
    indexed = indexed.where((li) => filter(li.value));
  }
  return indexed;
}