DateTimeWatcher class
create a Watcher of type DateTime, which reacts just like normal DateTime, but with watcher capabilities.
- Inheritance
-
- Object
- ChangeNotifier
- Watcher<
DateTime> - DateTimeWatcher
- Implemented types
- Available Extensions
Constructors
- DateTimeWatcher(DateTime initial)
Properties
- day → int
-
The day of the month
[1..31]
.no setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- hour → int
-
The hour of the day, expressed as in a 24-hour clock
[0..23]
.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
- isUtc → bool
-
True if this DateTime is set to UTC time.
no setteroverride
- microsecond → int
-
The microsecond
[0...999]
.no setteroverride - microsecondsSinceEpoch → int
-
The number of microseconds since
the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setteroverride
- millisecond → int
-
The millisecond
[0...999]
.no setteroverride - millisecondsSinceEpoch → int
-
The number of milliseconds since
the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setteroverride
- minute → int
-
The minute
[0...59]
.no setteroverride - month → int
-
The month
[1..12]
.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
- second → int
-
The second
[0...59]
.no setteroverride -
stream
→ Stream<
DateTime> -
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 - timeZoneName → String
-
The time zone name.
no setteroverride
- timeZoneOffset → Duration
-
The time zone offset, which
is the difference between local time and UTC.
no setteroverride
- v ↔ DateTime
-
Equivalent to the getter value but in shorter syntax.
getter/setter pairinherited
- value ↔ DateTime
-
The current value stored in this watcher.
getter/setter pairinherited
- weekday → int
-
The day of the week
monday
..sunday
.no setteroverride - year → int
-
The year.
no setteroverride
Methods
-
add(
Duration duration) → DateTime -
Returns a new DateTime instance with
duration
added to this.override -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
compareTo(
DateTime other) → int -
Compares this DateTime object to
other
, returning zero if the values are equal.override -
debounce(
Duration duration, void action(DateTime value)) → VoidCallback -
Registers a debounced callback which is invoked only after the notifier's value
is stable for the specified
duration
.inherited -
difference(
DateTime other) → Duration -
Returns a Duration with the difference when subtracting
other
from this.override -
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
-
isAfter(
DateTime other) → bool -
Returns true if this occurs after
other
.override -
isAtSameMomentAs(
DateTime other) → bool -
Returns true if this occurs at the same moment as
other
.override -
isBefore(
DateTime other) → bool -
Returns true if this occurs before
other
.override -
isEqual(
Object other) → bool -
Returns true if
other
is a DateTime at the same moment and in the same time zone (UTC or local). -
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(DateTime 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(
DateTime newValue) → void -
inherited
-
subtract(
Duration duration) → DateTime -
Returns a new DateTime instance with
duration
subtracted from this.override -
toIso8601String(
) → String -
Returns an ISO-8601 full-precision extended format representation.
override
-
toLocal(
) → DateTime -
Returns this DateTime value in the local time zone.
override
-
toString(
) → String -
A string representation of this object.
override
-
toUtc(
) → DateTime -
Returns this DateTime value in the UTC time zone.
override
-
updateIf(
bool condition(DateTime), DateTime 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 -
updateToNow(
) → DateTime - updates the current Watchers DateTime to Now and return it.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited