addIf method

Map<K, V> addIf(
  1. bool f(
    1. K key,
    2. V value
    ),
  2. K key,
  3. V value
)

Implementation

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