toggleValue method

void toggleValue(
  1. String value
)

Implementation

void toggleValue(String value) {
  final hasIt = contains(value);

  if (hasIt) {
    remove(value);
  } else {
    add(value);
  }
}