add method
V?
add(
- K key,
- V value
Implementation
V? add(K key, V value) {
if (this == null) return null;
V? result;
if (this!.containsKey(key)) {
result = this!.update(key, (_) => value);
} else {
result = this!.putIfAbsent(key, () => value);
}
return result;
}