lit_relative_date_time library
A Flutter package to generate relative dates to show differences in time in localized and human-readable format.
To use, import package:lit_relative_date_time/lit_relative_date_time.dart
.
Classes
- AnimatedRelativeDateTimeBuilder
-
A Flutter widget allowing to create a RelativeDateTime while providing
access to its corresponding localized
String
in human-readable format. The RelativeDateTime is always relative to the current timestamp. - RelativeDateFormat
- RelativeDateFormat localizes relative time stamps using the provided Locale.
- RelativeDateLocalization
-
A
model
class describing all data required for localizing aRelativeDateTime
. - RelativeDateTime
-
A
model
class describing a TimeDifference based on two comparable DateTime objects. - RelativeDateTimeBuilder
-
A Flutter widget allowing to create a RelativeDateTime while providing
access to its corresponding localized
String
in human-readable format. - RelativeDateTimeController
-
A
controller
class to calculate custom differences in time of two DateTime objects include on the provided relative date time. - TimeDifference
-
A
model
class describing a difference in time of two time stamps. - TimeDifferenceController
-
A LitRelativeDateTime
controller
class implementing checks performed on TimeDifference model classes.
Enums
- FormatComponent
- The sections of the formatted string
- LitTimeUnit
- A collection of all available time units.
Constants
- DAYS_PER_WK → const int
-
days
perweek
- HR_PER_DAY → const int
-
hours
perday
-
LOC_ALL
→ const List<
RelativeDateLocalization> - All available localizations.
- LOC_DE → const RelativeDateLocalization
-
German
localization - LOC_DEFAULT → const RelativeDateLocalization
- LOC_EN → const RelativeDateLocalization
-
English
localization - LOC_RU → const RelativeDateLocalization
-
Russian
localization - MIN_PER_HR → const int
-
minutes
perhour
- MNTHS_PER_YR → const int
-
months
peryear
- MS → const double
- A milisecond.
- MS_PER_DAY → const double
-
The miliseconds per day
8.64e+7
. - MS_PER_HOUR → const double
-
The milliseconds per hour
3.6e+6
. - MS_PER_MINUTE → const double
-
The milliseconds per minute
60000
. - MS_PER_MONTH → const double
-
The miliseconds per month
2.628e+9
. - MS_PER_SECOND → const double
-
The miliseconds per second
1000
. - MS_PER_WEEK → const double
-
The miliseconds per week
6.048e+8
. - MS_PER_YEAR → const double
-
The miliseconds per year
3.154e+10
. - PACKAGE_NAME → const String
- The package's name.
- SEC_PER_MIN → const int
-
seconds
perminute
- WKS_PER_MNTH → const int
-
weeks
permonth