filterWithIndex method

Map<K, V> filterWithIndex(
  1. bool test(
    1. V value,
    2. int index
    )
)

Returns a new Map containing all the elements of this Map where the value satisfies test.

Implementation

Map<K, V> filterWithIndex(bool Function(V value, int index) test) => {
      for (var (index, MapEntry(:key, :value)) in entries.indexed)
        if (test(value, index)) key: value
    };