LxNum<T extends num> class

A reactive number with fluent arithmetic extensions.

Inheritance

Constructors

LxNum(T initial, {String? name})
Creates a reactive number instance.

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
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<T>
A Stream that emits the latest value whenever it updates.
no setterinherited
value ↔ T
The current state of the reactive object.
getter/setter pairinherited

Methods

add(num other) → void
Adds other to the current value.
addListener(void listener()) → void
Adds a listener.
inherited
bind(Stream<T> externalStream) → void
Binds an external stream to this reactive variable.
inherited
call([T? v]) → T
Functional-style update and retrieval.
inherited
clampValue(T min, T max) → void
Clamps the value between min and max.
close() → void
Permanently closes the reactive object and releases all internal resources.
inherited
decrement() → void
Decrements the value by 1.
dispose() → void
Disposes the notifier.
inherited
divide(num other) → void
Divides the current value by other.
increment() → void
Increments the value by 1.
intDivide(num other) → void
Performs integer division by other.
mod(num other) → void
Assigns the result of value % other to the variable.
multiply(num other) → void
Multiplies the current value by other.
mutate(void mutator(T value)) → void
Mutates the value in place and triggers a refresh.
inherited
negate() → void
Negates the current value.
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
setValueInternal(T val, {bool notifyListeners = true}) → void
Internal setter for subclasses (Computed, etc.)
inherited
subtract(num other) → void
Subtracts other from the current value.
toString() String
A string representation of this object.
inherited
transform<R>(Stream<R> transformer(Stream<T> stream)) LxStream<R>
Transforms the stream of changes using transformer.
inherited
unbind() → void
Unbinds any external stream.
inherited
updateValue(T fn(T val)) → void
Updates the value using a transformation function.
inherited

Operators

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