FHUBoolValueNotifierExtension extension
BoolValueNotifierExtension
Extension on ValueNotifier<bool>
providing additional boolean-specific functionalities.
This extension simplifies toggling and other boolean operations directly on
the ValueNotifier without the need to perform actions in the value itself.
Example:
final boolValueNotifier = true.notifier;
boolValueNotifier.toggle(); // Toggles the boolean value.
- on
Methods
-
conditionalToggle(
{required bool condition}) → void - toggle the value of the ValueNotifier based on a condition.
-
delayedToggle(
Duration delay) → Future< void> - toggle after a specific time.
-
setFalse(
) → void - make the value of the ValueNotifier false
-
setTrue(
) → void - make the value of the ValueNotifier true
-
toggle(
) → void - toggle the value of the ValueNotifier
-
toggleWithCallback(
VoidCallback callback) → void - toggle the value of the ValueNotifier and run the provided function.
Operators
-
operator &(
bool other) → bool -
The logical conjunction ("and") of this and
other
. -
operator ^(
bool other) → bool -
The logical exclusive disjunction ("exclusive or") of this and
other
. -
operator |(
bool other) → bool -
The logical disjunction ("inclusive or") of this and
other
.