GlobalMaterialLocalizations constructor
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:
- The string that would be returned by Intl.canonicalizedLocale for the locale.
- The intl.DateFormat for formatYear.
- The intl.DateFormat for formatMediumDate.
- The intl.DateFormat for formatFullDate.
- The intl.DateFormat for formatMonthYear.
- The NumberFormat for formatDecimal (also used by formatHour and formatTimeOfDay when timeOfDayFormat doesn't use HourFormat.HH).
- 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 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;