addIndexIf method

Map<K, V> addIndexIf(
  1. bool f(
    1. K key,
    2. V value,
    3. int index
    ),
  2. K key,
  3. V value,
  4. int index,
)

Implementation

Map<K, V> addIndexIf(
    bool Function(K key, V value, int index) f, K key, V value, int index) {
  if (f(key, value, index)) {
    addEntries([MapEntry(key, value)]);
  }
  return this;
}