put method

void put(
  1. K key,
  2. V value
)

Add item

If the key already exists, it will be updated only if the value is different.

Parameters

  • key: The key to add
  • value: The value to add

Implementation

void put(K key, V value) {
  putIfAbsent(key, () => value);
}