removeItem method

void removeItem(
  1. T item
)

Remove a specific typed item from the list, Only if it exists

Implementation

void removeItem(T item){
  _validate((state){
    //find index
    int index = state.items.indexOf(item);

    if(index >= 0){
      //remove item
      state.remove(index);
    }
  });
}