toggle method

void toggle()

Flips the value (null becomes true).

Implementation

void toggle() => value = !(value ?? false);