Remove manual workaround for missing locales

This commit is contained in:
Roland Geider
2023-06-05 17:05:36 +02:00
parent 84bdb56b65
commit fcead12888
2 changed files with 1 additions and 15 deletions

View File

@@ -2,3 +2,4 @@ arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
nullable-getter: false
preferred-supported-locales: [ en ]

View File

@@ -158,21 +158,6 @@ class MyApp extends StatelessWidget {
},
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
// Workaround for https://github.com/flutter/flutter/issues/100857
localeResolutionCallback: (deviceLocale, supportedLocales) {
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');
},
),
),
);