filter method

Map<K, V> filter(
  1. bool test(
    1. K key,
    2. V value
    )
)

Implementation

Map<K, V> filter(bool Function(K key, V value) test) {
  if (this == null) return {};
  final map = <K, V>{};
  this!.forEach((key, value) {
    if (test(key, value)) map[key] = value;
  });
  return map;
}