make date picker accessible (#13502)

* make date picker accessible

* make test file lookup location-independent

* address some comments

* always wrap in IgnorePointer

* no bitmasks for flags and actions

* recommend List<*>
This commit is contained in:
Yegor
2017-12-14 20:38:39 -08:00
committed by GitHub
parent dc9c95375f
commit 235b64ed2f
6 changed files with 664 additions and 113 deletions

View File

@@ -76,14 +76,18 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
if (intl.DateFormat.localeExists(_localeName)) {
_fullYearFormat = new intl.DateFormat.y(_localeName);
_mediumDateFormat = new intl.DateFormat(kMediumDatePattern, _localeName);
_longDateFormat = new intl.DateFormat.yMMMMEEEEd(_localeName);
_yearMonthFormat = new intl.DateFormat('yMMMM', _localeName);
} else if (intl.DateFormat.localeExists(locale.languageCode)) {
_fullYearFormat = new intl.DateFormat.y(locale.languageCode);
_mediumDateFormat = new intl.DateFormat(kMediumDatePattern, locale.languageCode);
_longDateFormat = new intl.DateFormat.yMMMMEEEEd(locale.languageCode);
_yearMonthFormat = new intl.DateFormat('yMMMM', locale.languageCode);
} else {
_fullYearFormat = new intl.DateFormat.y();
_mediumDateFormat = new intl.DateFormat(kMediumDatePattern);
_longDateFormat = new intl.DateFormat.yMMMMEEEEd();
_yearMonthFormat = new intl.DateFormat('yMMMM');
}
@@ -115,6 +119,8 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
intl.DateFormat _mediumDateFormat;
intl.DateFormat _longDateFormat;
intl.DateFormat _yearMonthFormat;
static String _computeLocaleName(Locale locale) {
@@ -169,6 +175,11 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
return _mediumDateFormat.format(date);
}
@override
String formatFullDate(DateTime date) {
return _longDateFormat.format(date);
}
@override
String formatMonthYear(DateTime date) {
return _yearMonthFormat.format(date);