add method

  1. @override
void add(
  1. T item, {
  2. bool notify = true,
})
override

Adds an item to the collection.

Implementation

@override
void add(T item, {bool notify = true}) {
  // Incremental Update
  _itemCache[logic.getItemKey(item)!] = item;
  spatialIndex.add(logic.getItemKey(item)!, item, logic.getBounds(item));

  perform(logic.createAddOp(item), notify: notify);
  if (notify) _emit(ItemAdded(item));
  scheduleAutoSave();
}