feat(juice): button press feedback + fade screen transitions

Adds PressableScale (0.94 squish on tap-down) around the Adventure
FilledButton, Classic OutlinedButton, and each season-map stage node.
Replaces all in-app MaterialPageRoute pushes with a gentle fade+scale
PageRouteBuilder (320ms in, 240ms out) via a new fadeRoute helper.
This commit is contained in:
2026-06-13 18:12:07 +09:00
parent e1098949be
commit 536807e7c8
4 changed files with 171 additions and 104 deletions
+38 -34
View File
@@ -6,6 +6,8 @@ import '../../game/models/stage.dart';
import '../../l10n/gen/app_localizations.dart';
import '../../state/providers.dart';
import '../widgets/banner_ad_slot.dart';
import '../widgets/fade_route.dart';
import '../widgets/pressable_scale.dart';
import '../widgets/season_background.dart';
import 'game_screen.dart';
import 'season_map_screen.dart';
@@ -67,43 +69,45 @@ class HomeScreen extends ConsumerWidget {
),
],
const SizedBox(height: 44),
FilledButton(
style: FilledButton.styleFrom(
padding: const EdgeInsets.symmetric(
horizontal: 56, vertical: 18),
textStyle: Theme.of(context).textTheme.titleLarge,
PressableScale(
child: FilledButton(
style: FilledButton.styleFrom(
padding: const EdgeInsets.symmetric(
horizontal: 56, vertical: 18),
textStyle: Theme.of(context).textTheme.titleLarge,
),
onPressed: () {
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
Navigator.of(context).push(
fadeRoute(const SeasonMapScreen()),
);
},
child: Text(l10n.adventure),
),
onPressed: () {
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => const SeasonMapScreen()),
);
},
child: Text(l10n.adventure),
),
const SizedBox(height: 14),
OutlinedButton(
style: OutlinedButton.styleFrom(
padding: const EdgeInsets.symmetric(
horizontal: 40, vertical: 14),
textStyle: Theme.of(context).textTheme.titleMedium,
PressableScale(
child: OutlinedButton(
style: OutlinedButton.styleFrom(
padding: const EdgeInsets.symmetric(
horizontal: 40, vertical: 14),
textStyle: Theme.of(context).textTheme.titleMedium,
),
onPressed: () {
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
ref.read(seasonFlowProvider.notifier).clear();
ref.read(analyticsProvider).endlessStart();
ref.read(gameSessionProvider.notifier).startStage(
StageConfig.endless(
seed: DateTime.now().millisecondsSinceEpoch,
),
);
Navigator.of(context).push(
fadeRoute(const GameScreen()),
);
},
child: Text(l10n.classic),
),
onPressed: () {
if (!(ModalRoute.of(context)?.isCurrent ?? true)) return;
ref.read(seasonFlowProvider.notifier).clear();
ref.read(analyticsProvider).endlessStart();
ref.read(gameSessionProvider.notifier).startStage(
StageConfig.endless(
seed: DateTime.now().millisecondsSinceEpoch,
),
);
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => const GameScreen()),
);
},
child: Text(l10n.classic),
),
if (best > 0) ...[
const SizedBox(height: 10),
@@ -127,7 +131,7 @@ class HomeScreen extends ConsumerWidget {
child: IconButton(
icon: const Icon(Icons.settings, color: Colors.white70),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const SettingsScreen()),
fadeRoute(const SettingsScreen()),
),
),
),