Intl class
The main class for all i18n calls, containing references to other functions such as
The functionalities are called through getters on an Intl
instance, i.e.
final numberFormat = Intl(
ecmaPolicy: const AlwaysEcma(),
locale: Locale(language: 'en', country: 'US'),
).numberFormat;
print(numberFormat.percent().format(0.5)); //prints 50%
Constructors
- Intl({Locale? locale, EcmaPolicy ecmaPolicy = defaultPolicy, LocaleMatcher localeMatcher = LocaleMatcher.lookup, Data data = const BundleData()})
-
Intl.excludeLocales({Locale? locale, EcmaPolicy ecmaPolicy = defaultPolicy, List<
Locale> excludedLocales = const [], LocaleMatcher localeMatcher = LocaleMatcher.lookup}) -
Intl.includeLocales({Locale? locale, EcmaPolicy ecmaPolicy = defaultPolicy, List<
Locale> includedLocales = const [], LocaleMatcher localeMatcher = LocaleMatcher.lookup})
Properties
- data → Data
-
final
- ecmaPolicy → EcmaPolicy
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- locale ↔ Locale
-
getter/setter pair
- localeMatcher → LocaleMatcher
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
supportedLocales
→ List<
Locale> -
final
- useEcma → bool
-
Whether to use the browser with the current settings
no setter
Methods
-
collation(
[CollationOptions options = const CollationOptions()]) → Collation -
datetimeFormat(
[DateTimeFormatOptions options = const DateTimeFormatOptions()]) → DateTimeFormat -
displayNames(
[DisplayNamesOptions options = const DisplayNamesOptions()]) → DisplayNames -
listFormat(
[ListFormatOptions options = const ListFormatOptions()]) → ListFormat -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
numberFormat(
[NumberFormatOptions? options]) → NumberFormat -
plural(
[PluralRulesOptions? options]) → PluralRules -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited