GlobalMaterialLocalizations constructor

const GlobalMaterialLocalizations({
  1. required String localeName,
  2. required DateFormat fullYearFormat,
  3. required DateFormat compactDateFormat,
  4. required DateFormat shortDateFormat,
  5. required DateFormat mediumDateFormat,
  6. required DateFormat longDateFormat,
  7. required DateFormat yearMonthFormat,
  8. required DateFormat shortMonthDayFormat,
  9. required NumberFormat decimalFormat,
  10. required NumberFormat twoDigitZeroPaddedFormat,
})

Initializes an object that defines the material widgets' localized strings for the given locale.

The arguments are used for further runtime localization of data, specifically for selecting plurals, date and time formatting, and number formatting. They correspond to the following values:

  1. The string that would be returned by Intl.canonicalizedLocale for the locale.
  2. The DateFormat for formatYear.
  3. The DateFormat for formatShortDate.
  4. The DateFormat for formatMediumDate.
  5. The DateFormat for formatFullDate.
  6. The DateFormat for formatMonthYear.
  7. The DateFormat for formatShortMonthDay.
  8. The NumberFormat for formatDecimal (also used by formatHour and formatTimeOfDay when timeOfDayFormat doesn't use HourFormat.HH).
  9. The NumberFormat for formatHour and the hour part of formatTimeOfDay when timeOfDayFormat uses HourFormat.HH, and for formatMinute and the minute part of formatTimeOfDay.

The narrowWeekdays and firstDayOfWeekIndex properties use the values from the intl.DateFormat used by formatFullDate.

Implementation

const GlobalMaterialLocalizations({
  required String localeName,
  required intl.DateFormat fullYearFormat,
  required intl.DateFormat compactDateFormat,
  required intl.DateFormat shortDateFormat,
  required intl.DateFormat mediumDateFormat,
  required intl.DateFormat longDateFormat,
  required intl.DateFormat yearMonthFormat,
  required intl.DateFormat shortMonthDayFormat,
  required intl.NumberFormat decimalFormat,
  required intl.NumberFormat twoDigitZeroPaddedFormat,
}) : _localeName = localeName,
     _fullYearFormat = fullYearFormat,
     _compactDateFormat = compactDateFormat,
     _shortDateFormat = shortDateFormat,
     _mediumDateFormat = mediumDateFormat,
     _longDateFormat = longDateFormat,
     _yearMonthFormat = yearMonthFormat,
     _shortMonthDayFormat = shortMonthDayFormat,
     _decimalFormat = decimalFormat,
     _twoDigitZeroPaddedFormat = twoDigitZeroPaddedFormat;