diff --git a/packages/neon/neon/lib/src/app.dart b/packages/neon/neon/lib/src/app.dart index 7e2692e6..db9253bc 100644 --- a/packages/neon/neon/lib/src/app.dart +++ b/packages/neon/neon/lib/src/app.dart @@ -273,7 +273,7 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra supportedLocales: { ..._appImplementations .map((final app) => app.supportedLocales) - .reduce((final value, final element) => [...value, ...element]), + .expand((final element) => element), ...AppLocalizations.supportedLocales, }, themeMode: themeMode, diff --git a/packages/neon/neon/lib/src/utils/localizations.dart b/packages/neon/neon/lib/src/utils/localizations.dart index 3f04cad6..d3a3cdf8 100644 --- a/packages/neon/neon/lib/src/utils/localizations.dart +++ b/packages/neon/neon/lib/src/utils/localizations.dart @@ -5,7 +5,7 @@ part of '../../neon.dart'; /// When the system locale is not supported [fallbackLocale] will be used. Future appLocalizationsFromSystem([final Locale fallbackLocale = const Locale('en', 'US')]) async { final systemLocale = await findSystemLocale(); - final parts = systemLocale.split('_').map((final a) => a.split('.')).reduce((final a, final b) => [...a, ...b]); + final parts = systemLocale.split('_').map((final a) => a.split('.')).expand((final e) => e).toList(); final locale = Locale(parts[0], parts.length > 1 ? parts[1] : null); final isSupported = AppLocalizations.delegate.isSupported(locale);