deepCopyMap<K, V> function
Deeply copies map
.
copier
Copy Function for non-primitive types.
Implementation
Map<K, V>? deepCopyMap<K, V>(Map<K, V>? map, {Copier? copier}) {
if (map == null) return null;
if (map.isEmpty) return <K, V>{};
return map.map((K k, V v) => MapEntry<K, V>(
deepCopy(k, copier: copier) as K, deepCopy(v, copier: copier) as V));
}