LxBool class

A reactive boolean with specialized toggling methods.

LxBool provides semantic helpers like toggle, setTrue, and setFalse.

Inheritance

Constructors

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

Properties

equals bool Function(bool previous, bool current)?
Custom equality function. When null, uses ==.
finalinherited
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
isSensitive bool
Whether this reactive object contains sensitive data.
getter/setter pairinherited
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
Updates and retrieves the value using call syntax.
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
select<R>(R selector(bool value)) LxComputed<R>
Creates a specific selection of the state that only updates when the selected value changes.
inherited
setFalse() → void
Explicitly sets the value to false.
setTrue() → void
Explicitly sets the value to true.
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