entryOrNull method

MapEntry<K, V>? entryOrNull(
  1. K key
)

Return the key/value entry for the given key, or null if key is not in the map.

Implementation

MapEntry<K, V>? entryOrNull(K key) => _map.containsKey(key) //
    ? MapEntry(key, _map[key] as V)
    : null;