mapWhere<K2, V2> method

Map<K2, V2> mapWhere<K2, V2>(
  1. MapEntry<K2, V2> convert(
    1. K key,
    2. V value
    ),
  2. bool test(
    1. K key,
    2. V value
    )
)

Implementation

Map<K2, V2> mapWhere<K2, V2>(
    MapEntry<K2, V2> Function(K key, V value) convert,
    bool Function(K key, V value) test) {
  Map<K2, V2> result = {};
  forEach((key, value) {
    if (test(key, value)) {
      final entry = convert(key, value);
      result[entry.key] = entry.value;
    }
  });
  return result;
}