FlutterKronos class
Unlike the device clock, the time reported by Kronos is unaffected when the local time is changed while your app is running
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
getCurrentNtpTimeMs
→ Future<
int?> -
If the NTP server cannot be reached or Kronos has not yet been synced,
getCurrentTimeMs() will return time from the fallback clock and trigger syncInBackground().
If you'd rather control the fallback, you can use getCurrentNtpTimeMs(),
which returns null instead of falling back. To get metadata with an individual timestamp,
use KronosClock.getCurrentTime(), which returns an instance of KronosTime.
KronosTime contains the currentTime and the timeSinceLastNtpSyncMs,
which will be null if currentTime is coming from the device clock.
no setter
-
getCurrentTimeMs
→ Future<
int?> -
Accessing getCurrentTimeMs will return the local time based on the last known accurate time + delta since last sync.
no setter
-
getDateTime
→ Future<
DateTime?> -
no setter
-
getNtpDateTime
→ Future<
DateTime?> -
no setter
Static Methods
-
sync(
) → void