LxInt class

A reactive integer with arithmetic extensions.

Unboxed for maximum performance compared to a generic number container.

Inheritance

Constructors

LxInt(int initial, {String? name, bool isSensitive = false})
Creates a reactive integer instance.

Properties

equals bool Function(int previous, int 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
isSensitive bool
Whether this reactive object contains sensitive data.
getter/setter pairinherited
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<int>
A Stream that emits the latest value whenever it updates.
no setterinherited
value int
The current state of the reactive object.
getter/setter pairinherited

Methods

add(int other) → void
Adds other to the current value.
addListener(void listener()) → void
Adds a listener.
inherited
bind(Stream<int> externalStream) → void
Binds an external stream to this reactive variable.
inherited
call([int? v]) int
Updates and retrieves the value using call syntax.
inherited
clampValue(int min, int 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(int other) → void
Performs integer division by other.
increment() → void
Increments the value by 1.
mod(int other) → void
Assigns the result of value % other to the variable.
multiply(int other) → void
Multiplies the current value by other.
mutate(void mutator(int other)) → 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
select<R>(R selector(int value)) LxComputed<R>
Creates a specific selection of the state that only updates when the selected value changes.
inherited
subtract(int other) → void
Subtracts other from the current value.
toString() String
A string representation of this object.
inherited
transform<R>(Stream<R> transformer(Stream<int> stream)) LxStream<R>
Transforms the stream of changes using transformer.
inherited
unbind() → void
Unbinds any external stream.
inherited
updateValue(int fn(int val)) → void
Updates the value using a transformation function.
inherited

Operators

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