map<K2, V2> method

  1. @override
Map<K2, V2> map<K2, V2>(
  1. MapEntry<K2, V2> transform(
    1. String key,
    2. Object? 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(String key, Object? value) transform,
) {
  final result = <K2, V2>{};
  for (final key in keys) {
    final entry = transform(key, this[key]);
    result[entry.key] = entry.value;
  }
  return result;
}