File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -157,8 +157,15 @@ class MyApp extends StatelessWidget {
157
157
158
158
// Workaround for https://github.com/flutter/flutter/issues/100857
159
159
localeResolutionCallback: (deviceLocale, supportedLocales) {
160
- if (supportedLocales.contains (deviceLocale)) {
161
- return deviceLocale;
160
+ if (deviceLocale != null ) {
161
+ for (final supportedLocale in supportedLocales) {
162
+ // Since we currently don't support any country specific locales
163
+ // such as de-DE and de-AT, it's sufficient to just check it like
164
+ // this. Otherwise we will need more logic with .countryCode
165
+ if (supportedLocale.languageCode == deviceLocale.languageCode) {
166
+ return supportedLocale;
167
+ }
168
+ }
162
169
}
163
170
return const Locale ('en' );
164
171
},
You can’t perform that action at this time.
0 commit comments