TimeAgoLabels class
Localisable labels for WtHelper.timeAgo. Supply justNow and a format that turns a count + TimeUnit into a phrase, so any language — including its singular/dual/plural rules — plugs in without touching the framework.
Built-ins: TimeAgoLabels.enShort (default), TimeAgoLabels.en, TimeAgoLabels.ar.
Constructors
- TimeAgoLabels({required String justNow, required String format(int value, TimeUnit unit)})
-
const
- TimeAgoLabels.ar()
-
Arabic with correct singular/dual/plural forms:
منذ دقيقة,منذ دقيقتين,منذ 5 دقائق,منذ 30 ثانية(11+ falls back to the singular tamyiz form).factory - TimeAgoLabels.en()
-
Long English with pluralisation:
5 minutes ago,1 hour ago.factory - TimeAgoLabels.enShort()
-
Short English (default, backward compatible):
5m ago,3w ago,2mo ago.factory
Properties
- format → String Function(int value, TimeUnit unit)
-
Renders
valueofunitinto a phrase, e.g.(5, TimeUnit.minute).final - hashCode → int
-
The hash code for this object.
no setterinherited
- justNow → String
-
Phrase for durations under
justNowSeconds(and for future/skewed dates).final - 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