addItem method

void addItem(
  1. T item, {
  2. K? parentKey,
  3. bool prepend = true,
})

Adds a single item.

Throws if an item with the same key already exists.

Implementation

void addItem(T item, {K? parentKey, bool prepend = true}) {
  addItems([item], parentKey: parentKey, prepend: prepend);
}