shallowCopyMap<K, V> function

Map<K, V> shallowCopyMap<K, V>(
  1. Map<K, V> source
)

Returns a new map with the same entries as source. Keys and values are shared by reference (not deep-copied).

Example:

shallowCopyMap({'a': 1}); // a new {'a': 1}

Implementation

Map<K, V> shallowCopyMap<K, V>(Map<K, V> source) => Map<K, V>.of(source);