operator []= method

  1. @override
void operator []=(
  1. K key,
  2. V value
)
override

Returns the value associated with the specified key in the map. The key must be of type K. if Map contains key and the key is different than the key of the value, the old value is not removed.

Implementation

@override
void operator []=(K key, V value) {
  if (containsKey(key) && _keyFunc(value) == key) {
    _items.removeWhere((e) => key == _keyFunc(value));
  }
  add(value);
}