DoubleCachedWatcher class

DoubleCachedWatcher

A CachedWatcher specialized for double values. Best suited for caching floating-point numbers like percentages, dimensions, etc.

Inheritance
Available Extensions

Constructors

DoubleCachedWatcher(double initialValue, String key)

Properties

cache Future
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
initialValue double
finalinherited
isCaching bool
isCaching
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
key String
key
latefinalinherited
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<double>
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 double
Equivalent to the getter value but in shorter syntax.
getter/setter pairinherited
value double
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(double value)) VoidCallback
Registers a debounced callback which is invoked only after the notifier's value is stable for the specified duration.
inherited
deleteCache() Future<void>
deleteCache
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(double value)) VoidCallback
Registers a callback to be invoked whenever the ValueNotifier's value changes.
inherited
read(dynamic data) double?
read
override
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(double newValue) → void
inherited
startCaching() → void
startCaching
inherited
stopCaching() → void
stopCaching
inherited
toString() String
A string representation of this object.
inherited
updateIf(bool condition(double), double newValue) → void
Updates the ValueNotifier's value to newValue if condition returns true.
inherited
updateOnAction<R>(R action()) → R
Will notifyListeners after a specific action has been made, and optionally return a result R of certain type.
inherited
write(double value) → dynamic
write
override

Operators

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