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 <noreply@anthropic.com>
This commit is contained in:
@@ -345,6 +345,7 @@ class _GameScreenState extends ConsumerState<GameScreen>
|
||||
children: [
|
||||
for (var i = 0; i < 3; i++)
|
||||
TweenAnimationBuilder<double>(
|
||||
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<GameScreen>
|
||||
child: Text(
|
||||
l10n.almostThere((view.objectiveProgress * 100).round()),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.labelSmall,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user