relascope
relascope

Reputation: 4646

Using showDatePicker with Locale causes Unsupported operation

I try to use showDatePicker with a locale.

showDatePicker(
                    locale: const Locale('de'),
                    context: context,

And if I have localizationsDelegates in MaterialApp

MaterialApp(
  title: appTitle,
  theme: ImpexStyle.mainTheme,
  darkTheme: ImpexStyle.mainTheme,
  locale: const Locale('de'),
  localizationsDelegates: [
    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate,
    GlobalCupertinoLocalizations.delegate,
  ],
  supportedLocales: [
    const Locale('de'),
  ],

I get Unsupported operation: Cannot set value in unmodifiable Map

Upvotes: 0

Views: 812

Answers (1)

relascope
relascope

Reputation: 4646

doesn't work together with initializeDateFormatting

Upvotes: 3

Related Questions