LxBool class

A reactive boolean with specialized state manipulation methods.

LxBool simplifies common boolean operations like toggling and explicit true/false assignment.

Inheritance

Constructors

LxBool([bool initial = false, String? name])
Creates a reactive boolean. initial defaults to false.

Properties

graphDepth int
Returns the current depth in the dependency graph.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
hasListener bool
Whether there are active listeners.
no setterinherited
id int
A unique runtime identifier for this reactive instance.
finalinherited
isDisposed bool
Whether the reactive object has been closed/disposed.
no setterinherited
isFalse bool
Returns true if the current value is false.
no setter
isTrue bool
Returns true if the current value is true.
no setter
name String?
An optional descriptive name for debugging and profiling.
getter/setter pairinherited
onCancel → void Function()?
Called when the stream is cancelled.
finalinherited
onListen → void Function()?
Called when the stream is listened to.
finalinherited
ownerId String?
The registration key of the owning controller, if applicable.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<bool>
A Stream that emits the latest value whenever it updates.
no setterinherited
value bool
The current state of the reactive object.
getter/setter pairinherited

Methods

addListener(void listener()) → void
Adds a listener.
inherited
bind(Stream<bool> externalStream) → void
Binds an external stream to this reactive variable.
inherited
call([bool? v]) bool
Functional-style update and retrieval.
inherited
close() → void
Permanently closes the reactive object and releases all internal resources.
inherited
dispose() → void
Disposes the notifier.
inherited
mutate(void mutator(bool value)) → void
Mutates the value in place and triggers a refresh.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify() → void
Alias for refresh.
inherited
refresh() → void
Triggers a notification without changing the value.
inherited
removeListener(void listener()) → void
Removes a listener.
inherited
setFalse() → void
Explicitly sets the value to false.
setTrue() → void
Explicitly sets the value to true.
setValueInternal(bool val, {bool notifyListeners = true}) → void
Internal setter for subclasses (Computed, etc.)
inherited
toggle() → void
Toggles the current value.
toString() String
A string representation of this object.
inherited
transform<R>(Stream<R> transformer(Stream<bool> stream)) LxStream<R>
Transforms the stream of changes using transformer.
inherited
unbind() → void
Unbinds any external stream.
inherited
updateValue(bool fn(bool val)) → void
Updates the value using a transformation function.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited