mapEntries<K2, V2> method

Map<K2, V2> mapEntries<K2, V2>(
  1. MapEntry<K2, V2> transform(
    1. K key,
    2. V value
    )
)

Implementation

Map<K2, V2> mapEntries<K2, V2>(
  MapEntry<K2, V2> Function(K key, V value) transform,
) {
  if (this == null) return {};
  final map = <K2, V2>{};
  this!.forEach((key, value) {
    final entry = transform(key, value);
    map[entry.key] = entry.value;
  });
  return map;
}