FuzzyTimeLocale class
Configuration for localizing fuzzy time strings.
Supported locales:
- English
- Spanish
- French
- Portuguese
- German
- Italian
Each locale provides its own translations for time units and prefixes.
Constructors
- FuzzyTimeLocale({required FuzzyLocale locale, required String prefixAbout, required String prefixLessThan, required String futureWrapper(String), required String pastWrapper(String), required String futureWrapperShort(String), required String pastWrapperShort(String), required String now, required String shortNow, required String fewSeconds, required String second, required String minute, required String hour, required String day, required String week, required String month, required String year, required String pluralize(String unit, int count)})
-
const
Properties
- day → String
-
final
- fewSeconds → String
-
final
- futureWrapper → String Function(String)
-
final
- futureWrapperShort → String Function(String)
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hour → String
-
final
- locale → FuzzyLocale
-
final
- minute → String
-
final
- month → String
-
final
- now → String
-
final
- pastWrapper → String Function(String)
-
final
- pastWrapperShort → String Function(String)
-
final
- pluralize → String Function(String unit, int count)
-
final
- prefixAbout → String
-
final
- prefixLessThan → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- second → String
-
final
- shortNow → String
-
final
- week → String
-
final
- year → String
-
final
Methods
-
formatUnit(
int value, String unit) → String - Helper to format a value with a localized unit.
-
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 Properties
- current → FuzzyTimeLocale
-
Get the current locale.
no setter
Static Methods
-
setLocale(
FuzzyLocale locale) → void - Set the global locale for fuzzy time formatting.
Constants
- english → const FuzzyTimeLocale
- Default English locale
- french → const FuzzyTimeLocale
- French locale
- german → const FuzzyTimeLocale
- German locale
- italian → const FuzzyTimeLocale
- Italian locale
- portuguese → const FuzzyTimeLocale
- Portuguese locale
- spanish → const FuzzyTimeLocale
- Spanish locale