toggle method

void toggle()

Toggles the switch state between true and false.

Implementation

void toggle() {
  value = !value;
}