How to localise CupertinoDatePicker in flutter and getxcontroller


During my search I found some regular solution when no GetXcontroller included, like this

Taking above as inspiration, I created some code for my GetMaterialApp:

        theme: AppTheme(),
        translations: Language(),
        locale: getCurrentLocale(),
        fallbackLocale: Locale('en', 'US'),
        supportedLocales: [ // Here I got error, maybe because I am using GetXController
        const Locale('en', 'US'),
        const Locale('de', 'DE'),
        const Locale('fr', 'FR'),
        const Locale('zh', 'CN'),
        const Locale('ar', 'QA'),
        const Locale('es', 'ES'),
        debugShowCheckedModeBanner: false,
        localizationsDelegates: [
          DefaultCupertinoLocalizationsLocal.delegate, // code from above link

        home: SettingScreen(),

But as result, the CupertinoPicker didn’t recognise my local language, still using default english, does anyone know how to localise CupertinoDatePicker in flutter and getxcontroller, thanks!


Try adding those to localizationsDelegates:


Answered By – Gwhyyy

Answer Checked By – Candace Johnson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *