diff --git a/lib/ui/screens/splash_screen.dart b/lib/ui/screens/splash_screen.dart index 4253827..e75d57c 100644 --- a/lib/ui/screens/splash_screen.dart +++ b/lib/ui/screens/splash_screen.dart @@ -2,15 +2,17 @@ import 'package:flutter/material.dart'; import 'home_screen.dart'; +Widget _defaultNextScreen() => const HomeScreen(); + /// Logo-assembly splash: four glossy blocks fly in to form a 2x2 mark, the /// wordmark fades in, then we hand off. SaveRepository is already opened in /// main() so this doubles as perceived-zero loading time. class SplashScreen extends StatefulWidget { - const SplashScreen({super.key}); + const SplashScreen({super.key, this.nextScreen = _defaultNextScreen}); - /// Where the splash goes when finished; the season title card task - /// repoints this. - static Widget Function() nextScreen = () => const HomeScreen(); + /// Built when the splash finishes; the season title card task repoints + /// the default. + final Widget Function() nextScreen; @override State createState() => _SplashScreenState(); @@ -24,7 +26,7 @@ class _SplashScreenState extends State )..addStatusListener((status) { if (status == AnimationStatus.completed && mounted) { Navigator.of(context).pushReplacement( - MaterialPageRoute(builder: (_) => SplashScreen.nextScreen()), + MaterialPageRoute(builder: (_) => widget.nextScreen()), ); } });