map<K2, V2> method

  1. @override
Map<K2, V2> map<K2, V2>(
  1. MapEntry<K2, V2> convert(
    1. K key,
    2. V value
    )
)
override

Returns a new map where all entries of this map are transformed by the given convert function.

Implementation

@override
Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> Function(K key, V value) convert) {
  final newMap = HashMap<K2, V2>();
  forEach((key, value) {
    final entry = convert(key, value);
    newMap[entry.key] = entry.value;
  });
  return newMap;
}