getOrNull method
V?
getOrNull(
- K key
Retrieves the value for the specified key
from the map.
If the key does not exist, returns null.
Example:
var map = {'first': 1, 'second': 2};
print(map.getOrNull('third')); // Output: null
Implementation
V? getOrNull(K key) {
return containsKey(key) ? this[key] : null;
}