addItem method

dynamic addItem(
  1. T item
)

Implementation

addItem(T item) {
  final list = state.data?.items;
  list?.insert(0, item);

  super.update(state.data?.copyWith(
    items: list,
    addedItems: [item],
    updatedItems: [],
  ));
}