getOrNull method
V?
getOrNull(
- K key
Returns the value for the key or null if not found.
Example:
{'a': 1, 'b': 2}.getOrNull('c'); // null
{'a': 1, 'b': 2}.getOrNull('a'); // 1
Implementation
V? getOrNull(K key) => containsKey(key) ? this[key] : null;