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
+8 -4
View File
@@ -66,10 +66,13 @@ class HomeScreen extends ConsumerWidget {
horizontal: 56, vertical: 18),
textStyle: Theme.of(context).textTheme.titleLarge,
),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => const SeasonMapScreen()),
),
onPressed: () {
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => const SeasonMapScreen()),
);
},
child: Text(l10n.adventure),
),
const SizedBox(height: 14),
@@ -80,6 +83,7 @@ class HomeScreen extends ConsumerWidget {
textStyle: Theme.of(context).textTheme.titleMedium,
),
onPressed: () {
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
ref.read(gameSessionProvider.notifier).startStage(
StageConfig.endless(
seed: DateTime.now().millisecondsSinceEpoch,