DatetimeValidator class

A singleton class that validates the device's current time by comparing it with the accurate network time (NTP).

Use isDateTimeValid to check if the device time is within an acceptable range.

Constructors

DatetimeValidator.new()
Returns the singleton instance of DatetimeValidator.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
localDataSource ILocalDataSource
Used to get and store network time locally.
final
networkTime DateTime?
The network time used as the reference to validate the device's current time.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

isDateTimeValid({int toleranceInSeconds = 5}) Future<bool>
Validates the device's system time by comparing it with the network time (NTP).
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