putIfAbsent method
V
putIfAbsent(
- K key,
- V ifAbsent()
Put if absent
Implementation
V putIfAbsent(K key, V Function() ifAbsent) {
final newMap = Map<K, V>.from(value);
final sizeBefore = newMap.length;
final result = newMap.putIfAbsent(key, ifAbsent);
if (sizeBefore != newMap.length) value = newMap;
return result;
}