TimeDifference class

A model class to describe a relative date time based on the largest TimeUnit available and its difference relative to another date.

The value can be negative e.g. meaning the date is in the past relative to today.

Constructors

TimeDifference({required int value, required LitTimeUnit unit})
Creates a TimeDifference.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isSingular bool
States whether to localized the corresponding TimeDifference's time unit in singular form.
no setter
isSmallestUnit bool
States whether the TimeDifference'unit contains the smallest value available (second).
no setter
isZero bool
States wheter the TimeDifference's value is zero. If so, the difference is invalid and cannot be used for measuring accurate relative dates.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unit LitTimeUnit
The time unit of the difference
final
value int
The diffence to another date as an integer value.
final

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