fix: guard home buttons against double-tap double-push

This commit is contained in:
2026-06-12 07:22:18 +09:00
parent 94e62d3e41
commit 26adf98d73
+6 -2
View File
@@ -66,10 +66,13 @@ class HomeScreen extends ConsumerWidget {
horizontal: 56, vertical: 18), horizontal: 56, vertical: 18),
textStyle: Theme.of(context).textTheme.titleLarge, textStyle: Theme.of(context).textTheme.titleLarge,
), ),
onPressed: () => Navigator.of(context).push( onPressed: () {
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (_) => const SeasonMapScreen()), builder: (_) => const SeasonMapScreen()),
), );
},
child: Text(l10n.adventure), child: Text(l10n.adventure),
), ),
const SizedBox(height: 14), const SizedBox(height: 14),
@@ -80,6 +83,7 @@ class HomeScreen extends ConsumerWidget {
textStyle: Theme.of(context).textTheme.titleMedium, textStyle: Theme.of(context).textTheme.titleMedium,
), ),
onPressed: () { onPressed: () {
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
ref.read(gameSessionProvider.notifier).startStage( ref.read(gameSessionProvider.notifier).startStage(
StageConfig.endless( StageConfig.endless(
seed: DateTime.now().millisecondsSinceEpoch, seed: DateTime.now().millisecondsSinceEpoch,