conditionalMapIndexed<E> method

List<E> conditionalMapIndexed<E>(
  1. E? f(
    1. int index,
    2. T e
    )
)

Implementation

List<E> conditionalMapIndexed<E>(E? Function(int index, T e) f) {
  final List<E> items = [];
  for (int i = 0; i < length; i++) {
    final value = f(i, this[i]);
    if (value != null) items.add(value);
  }
  return items;
}