From 944c5733c962d2fc3a177ebe485d08f01a3a8183 Mon Sep 17 00:00:00 2001 From: airkjw Date: Thu, 11 Jun 2026 22:27:14 +0900 Subject: [PATCH] fix: defensive keys and overflow guard in result overlay - Add ValueKey(i) to each TweenAnimationBuilder in the star animation loop to prevent Flutter from reusing widget state during rebuild cycles - Add maxLines: 2 and overflow: TextOverflow.ellipsis to the almostThere Text widget to prevent overflow in the loss-state progress message Co-Authored-By: Claude Sonnet 4.6 --- lib/ui/screens/game_screen.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ui/screens/game_screen.dart b/lib/ui/screens/game_screen.dart index 1e45aa2..64fb891 100644 --- a/lib/ui/screens/game_screen.dart +++ b/lib/ui/screens/game_screen.dart @@ -345,6 +345,7 @@ class _GameScreenState extends ConsumerState children: [ for (var i = 0; i < 3; i++) TweenAnimationBuilder( + key: ValueKey(i), tween: Tween(begin: 0, end: 1), duration: Duration(milliseconds: 400 + i * 250), curve: Interval(i * 0.22, 1, curve: Curves.elasticOut), @@ -377,6 +378,8 @@ class _GameScreenState extends ConsumerState child: Text( l10n.almostThere((view.objectiveProgress * 100).round()), textAlign: TextAlign.center, + maxLines: 2, + overflow: TextOverflow.ellipsis, style: theme.textTheme.labelSmall, ), ),