toggle method
Toggles the boolean value.
Returns the opposite of the current value.
Example:
bool flag = true;
flag = flag.toggle(); // false
flag = flag.toggle(); // true
Implementation
bool toggle() => !this;
Toggles the boolean value.
Returns the opposite of the current value.
Example:
bool flag = true;
flag = flag.toggle(); // false
flag = flag.toggle(); // true
bool toggle() => !this;