toggle method

void toggle()

Reverses the current boolean value.

Implementation

void toggle() {
  value = !value;
}