mapHash<K, V> function
A deep hash of a nullable map — consistent with mapsEqual. Two maps that compare equal under mapsEqual produce the same hash. Null hashes to 0.
Implementation
int mapHash<K, V>(Map<K, V>? map) {
if (map == null) return 0;
return const DeepCollectionEquality().hash(map);
}