| .. | .. |
|---|
| 8 | 8 | import 'providers/providers.dart'; |
|---|
| 9 | 9 | import 'services/audio_service.dart'; |
|---|
| 10 | 10 | import 'services/purchase_service.dart'; |
|---|
| 11 | +import 'screens/splash_screen.dart'; |
|---|
| 11 | 12 | |
|---|
| 12 | 13 | void main() async { |
|---|
| 13 | 14 | WidgetsFlutterBinding.ensureInitialized(); |
|---|
| .. | .. |
|---|
| 48 | 49 | |
|---|
| 49 | 50 | class _PAILotAppState extends ConsumerState<PAILotApp> { |
|---|
| 50 | 51 | late final GoRouter _router; |
|---|
| 52 | + bool _showSplash = true; |
|---|
| 51 | 53 | |
|---|
| 52 | 54 | @override |
|---|
| 53 | 55 | void initState() { |
|---|
| .. | .. |
|---|
| 78 | 80 | themeMode: themeMode, |
|---|
| 79 | 81 | routerConfig: _router, |
|---|
| 80 | 82 | 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 | + }, |
|---|
| 81 | 94 | ); |
|---|
| 82 | 95 | } |
|---|
| 83 | 96 | } |
|---|