From 4af64ae89b375362e0c95e35818df643f930c18a Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 26 Apr 2025 13:37:03 +0800 Subject: [PATCH] :bug: Fix No CupertinoLocalizations found --- lib/main.dart | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 4fefbc5..f4b9b7f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -38,9 +38,7 @@ void main() async { path: 'assets/i18n', fallbackLocale: Locale('en', 'US'), useFallbackTranslations: true, - child: Overlay( - initialEntries: [OverlayEntry(builder: (_) => IslandApp())], - ), + child: IslandApp(), ), ), ), @@ -70,12 +68,21 @@ class IslandApp extends HookConsumerWidget { themeMode: ThemeMode.system, routerConfig: _appRouter.config(), supportedLocales: context.supportedLocales, - localizationsDelegates: [...context.localizationDelegates], + localizationsDelegates: [ + ...context.localizationDelegates, + ], // this contains the cupertino one locale: context.locale, builder: (context, child) { - return WindowScaffold( - router: _appRouter, - child: child ?? const SizedBox.shrink(), + return Overlay( + initialEntries: [ + OverlayEntry( + builder: + (_) => WindowScaffold( + router: _appRouter, + child: child ?? const SizedBox.shrink(), + ), + ), + ], ); }, );