removeItem method

void removeItem(
  1. Value item
)

Remove item to the current items of the current state.

Implementation

void removeItem(Value item) {
  var items = state.items;
  if (items.isNotEmpty) {
    items = SingleFieldBloc._itemsWithoutDuplicates([...items]..remove(item));
    emit(state.copyWith(
      items: items,
      value: items.contains(value) ? null : Param(null),
    ));
  }
}