toggleValue method

bool? toggleValue()

Implementation

bool? toggleValue() {
  bool? value = read();
  if (value != null) {
    return update(!value);
  } else if (defaultValue != null) {
    return update(!defaultValue!);
  }
  return null;
}