RelativeTime class
Relative time formatting utilities
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 Methods
-
formatDuration(
Duration duration, {bool verbose = false}) → String - Format duration (e.g., "2h 30m", "45s")
-
formatTimeRemaining(
DateTime targetDate) → String - Format time remaining (countdown)
-
getRelativeTime(
DateTime date, [String locale = 'en_US']) → String - Returns relative time string (e.g., "2 hours ago", "in 3 days")
-
getRelativeTimeShort(
DateTime date, [String locale = 'en_US']) → String - Short relative time format (e.g., "2h", "3d", "now")