add method

void add(
  1. T item, {
  2. String? key,
})

Adds item to the map, extending the length by one.

This method accepts a String as a key or an ItemSerializable, where its id is going to be used.

Implementation

void add(T item, {String? key}) {
  _items[_getKey(key ?? item)] = item;
}