mapValues<K, V1, V2> function
Transforms values in a Map
map Source map
transform Value transformation function
Implementation
Map<K, V2> mapValues<K, V1, V2>(
Map<K, V1> map,
V2 Function(V1 value) transform,
) {
return Map.fromEntries(
map.entries.map(
(entry) => MapEntry(entry.key, transform(entry.value)),
),
);
}