diff --git a/lib/main.dart b/lib/main.dart index 94aa08b2..252ba121 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -157,8 +157,15 @@ class MyApp extends StatelessWidget { // Workaround for https://github.com/flutter/flutter/issues/100857 localeResolutionCallback: (deviceLocale, supportedLocales) { - if (supportedLocales.contains(deviceLocale)) { - return deviceLocale; + if (deviceLocale != null) { + for (final supportedLocale in supportedLocales) { + // Since we currently don't support any country specific locales + // such as de-DE and de-AT, it's sufficient to just check it like + // this. Otherwise we will need more logic with .countryCode + if (supportedLocale.languageCode == deviceLocale.languageCode) { + return supportedLocale; + } + } } return const Locale('en'); },