toggle method

void toggle(
  1. List<S2Choice<T>> choices, {
  2. bool? pull,
})

Toggle put/pull the supplied values from the selection

Implementation

void toggle(List<S2Choice<T>> choices, {bool? pull}) {
  if (pull == true) {
    omit(choices);
  } else if (pull == false) {
    merge(choices);
  } else {
    if (hasAny(choices)) {
      omit(choices);
    } else {
      merge(choices);
    }
  }
}