Home > Blockchain >  How to capitalize the first letter of months and weekdays in Flutter built-in widgets?
How to capitalize the first letter of months and weekdays in Flutter built-in widgets?

Time:01-09

I have an app that can be in either English, Spanish and Portuguese, and I'm experiencing an issue that the months and weekdays names in Portuguese and in Spanish don't start with a capital letter.

I know that in Portuguese and in Spanish these names don't get the first letter capitalized, but in this case it's starting the sentence, and in that case, they should start with a capital letter.

What I'm doing:

showDatePicker(
  context: context,
  initialDate: DateTime.now(),
  firstDate: DateTime.now().subtract(const Duration(days: 50)),
  lastDate: DateTime.now().add(const Duration(days: 50)),
);

My App Preview

The locale isn't specified in the showDatePicker() because it's already in the MaterialApp.

CodePudding user response:

Oi

Although I would love to have a solution, i don't think this is actually possible without using a third-part package DatePickers or even without changing root flutter classes, I've a project that uses the default DatePicker too, and although it's a completely commercial app, I don't think it will matter that much anyway, if the rest of the application is beautiful and presentable, your job is pretty much done and you shouldn't worry about it...

But of course it's a great idea to suggest to the Flutter Creators.

Boa sorte irmão, nos mantenha atualizado se possível. (Good luck brother, keep us updated if possible.)

  • Related