DurationWatcher class
create a Watcher of type Duration, which reacts just like normal Duration, but with watcher capabilities.
- Inheritance
-
- Object
- ChangeNotifier
- Watcher<
Duration> - DurationWatcher
- Implemented types
- Available Extensions
Constructors
- DurationWatcher(Duration initial)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- inDays → int
-
documentation available in the original overridden method.
no setteroverride
- inHours → int
-
documentation available in the original overridden method.
no setteroverride
- inMicroseconds → int
-
documentation available in the original overridden method.
no setteroverride
- inMilliseconds → int
-
documentation available in the original overridden method.
no setteroverride
- inMinutes → int
-
documentation available in the original overridden method.
no setteroverride
- inSeconds → int
-
documentation available in the original overridden method.
no setteroverride
- 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
- isNegative → bool
-
documentation available in the original overridden method.
no setteroverride
- 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<
Duration> -
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 ↔ Duration
-
Equivalent to the getter value but in shorter syntax.
getter/setter pairinherited
- value ↔ Duration
-
The current value stored in this watcher.
getter/setter pairinherited
Methods
-
abs(
) → Duration -
documentation available in the original overridden method.
override
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
compareTo(
Duration other) → int -
documentation available in the original overridden method.
override
-
debounce(
Duration duration, void action(Duration 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(Duration 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(
Duration newValue) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateIf(
bool condition(Duration), Duration 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 *(
num factor) → Duration -
documentation available in the original overridden method.
override
-
operator +(
Duration other) → Duration -
documentation available in the original overridden method.
override
-
operator -(
Duration other) → Duration -
documentation available in the original overridden method.
override
-
operator <(
Duration other) → bool -
documentation available in the original overridden method.
override
-
operator <=(
Duration other) → bool -
documentation available in the original overridden method.
override
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
Duration other) → bool -
documentation available in the original overridden method.
override
-
operator >=(
Duration other) → bool -
documentation available in the original overridden method.
override
-
operator unary-(
) → Duration -
documentation available in the original overridden method.
override
-
operator ~/(
int quotient) → Duration -
documentation available in the original overridden method.
override