NumWatcher class
allows to quickly create a Watcher of type num.
- Inheritance
-
- Object
- ChangeNotifier
- Watcher<
num> - NumWatcher
- Available Extensions
Constructors
- NumWatcher(num initial)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isDisposed → bool
-
Flag which returns true if you called the dispose method.
It is useful when you want to safely do some operations on the Watcher without getting an exception if it gets disposed.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- safeMode → bool
-
safeMode if enabled will not allow any setting of value or notifying any listeners if the Watcher isDisposed
finalinherited
-
stream
→ Stream<
num> -
Converts the Watcher into a Stream. This stream emits values whenever the
value changes. The use of
distinct
ensures that consecutive duplicate values are filtered out, thus the stream only emits when the value actually changes.no setterinherited - v ↔ num
-
Equivalent to the getter value but in shorter syntax.
getter/setter pairinherited
- value ↔ num
-
The current value stored in this watcher.
getter/setter pairinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
debounce(
Duration duration, void action(num value)) → VoidCallback -
Registers a debounced callback which is invoked only after the notifier's value
is stable for the specified
duration
.inherited -
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onChange(
void action(num value)) → VoidCallback -
Registers a callback to be invoked whenever the
ValueNotifier
's value changes.inherited -
refresh(
) → void -
Rebuilds and trigger any listeners of any WatchValue or
watch
attached to that Watcher.inherited -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
setWithoutNotify(
num newValue) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateIf(
bool condition(num), num newValue) → void -
Updates the
ValueNotifier
's value tonewValue
ifcondition
returns true.inherited -
updateOnAction<
R> (R action()) → R -
Will notifyListeners after a specific
action
has been made, and optionally return a resultR
of certain type.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited