toggle method

bool toggle()

Returns the opposite boolean value.

Behavior:

  • true → false
  • false → true
  • null → true

Example: dart bool? flag = null; flag.toggle(); // true

Implementation

bool toggle() => validate().toggle();