0

I want to add a custom language to date picker that not supported by flutter localizations. How can I add a custom locale? I only want to change the words in datepicker.

Future<void> presentDatePicker(ctx) async {
await DatePicker.showDatePicker(
  ctx,
  showTitleActions: true,
  minTime: DateTime(2020, 1, 1),
  maxTime: DateTime(2021, 12, 31),
  currentTime: DateTime.now(),
).then((pickedDate) {
  if (pickedDate == null) {
    return;
  } else {
    viewDate = pickedDate;
    choosenDate = DateFormat('yyyy-MM-dd').format(pickedDate);
    print(choosenDate);
  }
  notifyListeners();
});

}

  • See https://stackoverflow.com/questions/61529343/how-to-change-language-of-show-date-picker-in-flutter/61537713#61537713 for your answer. – omchiii May 20 '21 at 14:59
  • @OmerBayram It is not a solution for me, because the language that I want to add is not supported by Locale. Turkmen language is not supported – Myrat Gurdyyew May 21 '21 at 12:27

0 Answers0