IntlString constructor

IntlString(
  1. String value, {
  2. Locale? locale,
  3. Locale currentLocaleFunction()?,
})

Constructor

Notes:

  • If locale is not set or is null, currentLocaleFunction will be used.
  • If currentLocaleFunction is not null, it will be called to get the current locale.
  • If Locale is set, it will be used and currentLocaleFunction will be ignored.

Implementation

IntlString(
  this.value, {
  Locale? locale,
  Locale Function()? currentLocaleFunction,
}) : _languageTag =
         (locale ??
                 (currentLocaleFunction != null
                     ? currentLocaleFunction()
                     : getCurrentLocale()))
             .toLanguageTag();