toggle method

void toggle()

Toggle the state and notify listeners

Implementation

void toggle() {
  state = !state;
}