DateTimeNotifier class

create a ValueNotifier of type DateTime, which reacts just like normal DateTime, but with notifier capabilities.

Inheritance
Implemented types
Available extensions

Constructors

DateTimeNotifier(DateTime initial)
Creates a notifier backed by an initial DateTime value.

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
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
notifier → DateTimeNotifier

Available on DateTime, provided by the FHUDateTimeNotifierEx extension

Creates a DateTimeNotifier instance from the current DateTime value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
second → int
The second [0...59].
no setteroverride
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
value ↔ DateTime
The current value stored in this notifier.
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
builder(Widget builder(BuildContext context)) → Widget

Available on Listenable, provided by the FHUListenableExtension extension

Creates a ListenableBuilder widget that listens to this Listenable.
compareTo(DateTime other) → int
Compares this DateTime object to other, returning zero if the values are equal.
override
copyWith({int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond, bool? isUtc}) → DateTime

Available on DateTime, provided by the DateTimeCopyWith extension

Creates a new DateTime from this one by updating individual properties.
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.
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.
override
refresh() → void
Re-emits the current DateTime without changing it.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
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
update(DateTime newValue) → void
similar to value setter but this one force trigger the notifyListeners() event if newValue == value.
updateToNow() → DateTime
updates the current ValueNotifiers DateTime to Now and return it.

Operators

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