flattenMaps<K2, V2> method

ImmortalMap<K2, V2> flattenMaps<K2, V2>()

Flattens a map of mutable maps by building a new map from the nested map entries.

If this map contains only instances of Map<K2, V2> the new map will be created correctly, otherwise an exception is thrown.

See flatten.

Implementation

ImmortalMap<K2, V2> flattenMaps<K2, V2>() => ImmortalMap.fromEntries(
    cast<K, Map<K2, V2>>().mapEntries((_, map) => map.entries).flatten());