GlobalMaterialLocalizations constructor

const GlobalMaterialLocalizations({@required String localeName, @required DateFormat fullYearFormat, @required DateFormat mediumDateFormat, @required DateFormat longDateFormat, @required DateFormat yearMonthFormat, @required NumberFormat decimalFormat, @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 intl.DateFormat for formatYear.
  3. The intl.DateFormat for formatMediumDate.
  4. The intl.DateFormat for formatFullDate.
  5. The intl.DateFormat for formatMonthYear.
  6. The NumberFormat for formatDecimal (also used by formatHour and formatTimeOfDay when timeOfDayFormat doesn't use HourFormat.HH).
  7. 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.


const GlobalMaterialLocalizations({
  @required String localeName,
  @required intl.DateFormat fullYearFormat,
  @required intl.DateFormat mediumDateFormat,
  @required intl.DateFormat longDateFormat,
  @required intl.DateFormat yearMonthFormat,
  @required intl.NumberFormat decimalFormat,
  @required intl.NumberFormat twoDigitZeroPaddedFormat,
}) : assert(localeName != null),
     _localeName = localeName,
     assert(fullYearFormat != null),
     _fullYearFormat = fullYearFormat,
     assert(mediumDateFormat != null),
     _mediumDateFormat = mediumDateFormat,
     assert(longDateFormat != null),
     _longDateFormat = longDateFormat,
     assert(yearMonthFormat != null),
     _yearMonthFormat = yearMonthFormat,
     assert(decimalFormat != null),
     _decimalFormat = decimalFormat,
     assert(twoDigitZeroPaddedFormat != null),
     _twoDigitZeroPaddedFormat = twoDigitZeroPaddedFormat;