When handling dates in Flutter, I'm used to using the buildt-in Localizations.localeOf(context).languageCode to get the correct format on dates and so on. An example of formatting dates: DateFormat.yMMMMd(Localizations.localeOf(context).languageCode).format(value). The date is then formatted to to match the language of the device. I'd like to be able to do the same with this package, but it doesn't accept a language code string. Instead I'd have to do something like this;
DateTimePickerLocale dateTimePickerLocale;
switch (locale.languageCode) {
case 'nb':
dateTimePickerLocale = DateTimePickerLocale.no_nb;
break;
case ...
default:
dateTimePickerLocale = DateTimePickerLocale.en_us;
break;
}
This is not a great solution, since it would have to be updated every time a language is added. It would be a much more flexible solution to let the showSimpleDatePicker method accept a language code string instead.
When handling dates in Flutter, I'm used to using the buildt-in
Localizations.localeOf(context).languageCode
to get the correct format on dates and so on. An example of formatting dates:DateFormat.yMMMMd(Localizations.localeOf(context).languageCode).format(value)
. The date is then formatted to to match the language of the device. I'd like to be able to do the same with this package, but it doesn't accept a language code string. Instead I'd have to do something like this;This is not a great solution, since it would have to be updated every time a language is added. It would be a much more flexible solution to let the showSimpleDatePicker method accept a language code string instead.