addItem method
Inserts item under toSection at index (or at the end).
Implementation
void addItem(
Item item, {
required K toSection,
int? index,
bool animate = true,
}) {
_checkNotDisposed();
_requireSection(toSection, "addItem");
_tree.insert(
parentKey: SectionKey<K>(toSection),
node: TreeNode(
key: ItemKey<K>(itemKeyOf(item)),
data: ItemPayload<Section, Item>(item),
),
index: index,
animate: animate,
);
}