toggle method
Toggles the boolean state, defaulting to false if null.
Implementation
void toggle({bool shouldNotify = true, String? tag}) {
state = !(state ?? false);
if (shouldNotify && WidgetsBinding.instance.isRootWidgetAttached) {
_TagRegistry.set(this, tag);
notify();
WidgetsBinding.instance
.addPostFrameCallback((_) => _TagRegistry.clear(this));
}
}