toggle method

void toggle()

Sets the expanded state to the opposite of the current state.

Implementation

void toggle() {
  expanded = !expanded;
}