copy<K, V> static method

Map<K, V?> copy<K, V>(
  1. Map<K, V?> source,
  2. Map<K, V?> dest, [
  3. bool filter(
    1. K key,
    2. V? value
    )?
])

Copies the given map (source) to the destination (dest).

Implementation

static Map<K, V?> copy<K, V>(Map<K, V?> source, Map<K, V?> dest,
    [bool filter(K key, V? value)?]) {
  for (final key in source.keys) {
    final value = source[key];
    if (filter != null && filter(key, value))
      dest[key] = value;
  }
  return dest;
}