cloneMap<K, V> method
Return an untyped Map<K, dynamic> with values deep-cloned.
Keys are reused as-is (not cloned). The returned map's values are cloned without attempting typed casts; use this when map values may be heterogeneous or contain nested plain maps.
Preserves the concrete Map implementation (e.g. LinkedHashMap,
HashMap, UnmodifiableMapView).
Implementation
@override
Map<K, dynamic> cloneMap<K, V>(Map<K, V> source) {
if (_nestIndex > nestLimit) {
throw LimitExceededException('depth', _nestIndex);
}
_nestIndex++;
try {
return super.cloneMap<K, V>(source);
} finally {
_nestIndex--;
}
}