BoolNotifier class

allows to quickly create a ValueNotifier of type bool.

Inheritance
Available extensions

Constructors

BoolNotifier.new(bool initial)

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value bool
The current value stored in this notifier.
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
builder(Widget builder(BuildContext context)) Widget

Available on Listenable, provided by the FHUListenableExtension extension

Creates a ListenableBuilder widget that listens to this Listenable.
conditionalToggle({required bool condition}) → void

Available on ValueNotifier<bool>, provided by the FHUBoolValueNotifierExtension extension

toggle the value of the ValueNotifier based on a condition.
delayedToggle(Duration delay) Future<void>

Available on ValueNotifier<bool>, provided by the FHUBoolValueNotifierExtension extension

toggle after a specific time.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
override
refresh() → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setFalse() → void

Available on ValueNotifier<bool>, provided by the FHUBoolValueNotifierExtension extension

make the value of the ValueNotifier false
setTrue() → void

Available on ValueNotifier<bool>, provided by the FHUBoolValueNotifierExtension extension

make the value of the ValueNotifier true
toggle() → void

Available on ValueNotifier<bool>, provided by the FHUBoolValueNotifierExtension extension

toggle the value of the ValueNotifier
toggleWithCallback(VoidCallback callback) → void

Available on ValueNotifier<bool>, provided by the FHUBoolValueNotifierExtension extension

toggle the value of the ValueNotifier and run the provided function.
toString() String
A string representation of this object.
inherited
update(bool newValue) → void
similar to value setter but this one force trigger the notifyListeners() event if newValue == value.

Operators

operator &(bool other) bool

Available on ValueNotifier<bool>, provided by the FHUBoolValueNotifierExtension extension

The logical conjunction ("and") of this and other.
operator ==(Object other) bool
The equality operator.
inherited
operator ^(bool other) bool

Available on ValueNotifier<bool>, provided by the FHUBoolValueNotifierExtension extension

The logical exclusive disjunction ("exclusive or") of this and other.
operator |(bool other) bool

Available on ValueNotifier<bool>, provided by the FHUBoolValueNotifierExtension extension

The logical disjunction ("inclusive or") of this and other.