Flutter arabic showDatePicker Morocco localization

Viewed 1460

I want to make a flutter date picker with the Arabic language but with some changes, this is my code :

  locale: Locale('ar', 'MA'),
  localizationsDelegates: [
    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate,
    GlobalCupertinoLocalizations.delegate,
  ],
  supportedLocales: [
    Locale('ar', 'MA'),
  ],

result : enter image description here

What I want is this (changes in red color) :

enter image description here

Please any help.

1 Answers

Finally I found a solution for my post : in my splash screen I override the DateSymbols values as desired like this :

void initState() {
super.initState();
DateFormat arLangue = new DateFormat('', 'ar');
arLangue.dateSymbols.MONTHS = myDateSymboles.MONTHS;
arLangue.dateSymbols.FIRSTDAYOFWEEK = 7;
arLangue.dateSymbols.ZERODIGIT = "0";}

Thanks lot

Related