Reactive<T> class
A generic class representing a reactive variable. It allows tracking and updating the value of the variable.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
listeners
→ List<
Function> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ T
-
Retrieves the current value of the reactive variable.
getter/setter pair
-
valueNotifier
→ ValueNotifier<
T> -
no setter
Methods
-
addListener(
dynamic listener(T value), {String? listenerName}) → dynamic -
Adds a listener to the list of listeners to a Reactive variable
The listener function will be called with the current value gets changed.
@param
listenerThe listener function to add. -
bindStream(
Stream< T> stream) → void -
destinationReactive.bindStream(sourceStream)here, the value of Reactive variabledestinationwill be updated and refresh the dependent Observers, whenever a new value is emitted fromsourceStream. -
close(
) → void -
Returns a
ReactiveNotifierobject associated with this Reactive instance. TheReactiveNotifierallows listening to changes in the reactive variable. Closes the underlying stream controller. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → void - Triggers an update by emitting the current value and help update Observer widget.
-
removeAllListeners(
) → dynamic - Removes all the listeners from a Reactive variable
-
removeListener(
{required String listenerName}) → dynamic - remove a particular listener with name specified previously
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited