IntCachedWatcher class
IntCachedWatcher
A CachedWatcher specialized for integer values. Ideal for caching counts, indexes, and other integer-based settings.
- Inheritance
-
- Object
- ChangeNotifier
- Watcher<
int> - CachedWatcher<
int> - IntCachedWatcher
- Available Extensions
Constructors
- IntCachedWatcher(int 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 → int
-
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<
int> -
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 ↔ int
-
Equivalent to the getter value but in shorter syntax.
getter/setter pairinherited
- value ↔ int
-
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(int 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(int value)) → VoidCallback -
Registers a callback to be invoked whenever the
ValueNotifier
's value changes.inherited -
read(
dynamic data) → int? -
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(
int newValue) → void -
inherited
-
startCaching(
) → void -
startCaching
inherited
-
stopCaching(
) → void -
stopCaching
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateIf(
bool condition(int), int 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 -
write(
int value) → dynamic -
write
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited