put method
void
put(
- K key,
- V value
Add item
If the key already exists, it will be updated only if the value is different.
Parameters
key
: The key to addvalue
: The value to add
Implementation
void put(K key, V value) {
putIfAbsent(key, () => value);
}