mapKeys<K2> method

Map<K2, V> mapKeys<K2>(
  1. K2 convert(
    1. K key
    )
)

Applies a transformation function to the keys of the Map.

Parameters

  • convert: The transformation function to apply to the keys

Returns

  • A new Map with transformed keys

Implementation

Map<K2, V> mapKeys<K2>(K2 Function(K key) convert) {
  return map<K2, V>((key, value) => MapEntry(convert(key), value));
}