Matthias Nott
9 days ago 525030c3caccef27a1da44605d28e259dc1cc17c
lib/main.dart
....@@ -8,6 +8,7 @@
88 import 'providers/providers.dart';
99 import 'services/audio_service.dart';
1010 import 'services/purchase_service.dart';
11
+import 'screens/splash_screen.dart';
1112
1213 void main() async {
1314 WidgetsFlutterBinding.ensureInitialized();
....@@ -48,6 +49,7 @@
4849
4950 class _PAILotAppState extends ConsumerState<PAILotApp> {
5051 late final GoRouter _router;
52
+ bool _showSplash = true;
5153
5254 @override
5355 void initState() {
....@@ -78,6 +80,17 @@
7880 themeMode: themeMode,
7981 routerConfig: _router,
8082 debugShowCheckedModeBanner: false,
83
+ builder: (context, child) {
84
+ return Stack(
85
+ children: [
86
+ child ?? const SizedBox.shrink(),
87
+ if (_showSplash)
88
+ SplashScreen(onComplete: () {
89
+ if (mounted) setState(() => _showSplash = false);
90
+ }),
91
+ ],
92
+ );
93
+ },
8194 );
8295 }
8396 }