Reactive<T> class

A reactive value container that notifies listeners when its value changes. Similar to GetX's Rx pattern but with enhanced functionality.

Constructors

Reactive(T _value)
Creates a new reactive value with the given initial value.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isDisposed → bool
Gets whether this reactive value has been disposed.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stream → Stream<T>
Gets a stream of value changes.
no setter
value ↔ T
Gets the current value.
getter/setter pair

Methods

dispose() → void
Disposes this reactive value and cleans up all listeners.
listen(void listener(T)) → VoidCallback
Adds a listener that will be called whenever the value changes. Returns a function that can be called to remove the listener.
listenWithPrevious(void listener(T newValue, T oldValue)) → VoidCallback
Adds a listener that includes both new and old values.
map<R>(R mapper(T)) → Reactive<R>
Maps this reactive value to another reactive value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
update(T updater(T)) → void
Updates the value using a function.

Operators

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