diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index fc72489..be89dd1 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -20,5 +20,13 @@ "type": "int" } } + }, + "almostThere": "{percent}% complete!", + "@almostThere": { + "placeholders": { + "percent": { + "type": "int" + } + } } } diff --git a/lib/l10n/app_ko.arb b/lib/l10n/app_ko.arb index 5dd475f..4e563ff 100644 --- a/lib/l10n/app_ko.arb +++ b/lib/l10n/app_ko.arb @@ -13,5 +13,6 @@ "giveUp": "포기하기", "playAgain": "다시 하기", "nextStage": "다음 스테이지", - "streakMilestone": "{days}일 연속 플레이! 대단해요!" + "streakMilestone": "{days}일 연속 플레이! 대단해요!", + "almostThere": "{percent}% 달성!" } diff --git a/lib/ui/screens/game_screen.dart b/lib/ui/screens/game_screen.dart index 45daef4..1e45aa2 100644 --- a/lib/ui/screens/game_screen.dart +++ b/lib/ui/screens/game_screen.dart @@ -344,16 +344,46 @@ class _GameScreenState extends ConsumerState mainAxisSize: MainAxisSize.min, children: [ for (var i = 0; i < 3; i++) - Icon( - Icons.star, - size: 40, - color: i < view.starsEarned - ? Colors.amber - : Colors.white24, + TweenAnimationBuilder( + tween: Tween(begin: 0, end: 1), + duration: Duration(milliseconds: 400 + i * 250), + curve: Interval(i * 0.22, 1, curve: Curves.elasticOut), + builder: (context, v, child) => + Transform.scale(scale: v, child: child), + child: Icon( + Icons.star, + size: 44, + color: i < view.starsEarned ? Colors.amber : Colors.white24, + ), ), ], ), ], + if (view.phase == GamePhase.lost && view.objectiveProgress > 0) ...[ + const SizedBox(height: 16), + SizedBox( + width: 88, + height: 88, + child: Stack( + fit: StackFit.expand, + children: [ + CircularProgressIndicator( + value: view.objectiveProgress, + strokeWidth: 7, + backgroundColor: Colors.white12, + color: Colors.amber, + ), + Center( + child: Text( + l10n.almostThere((view.objectiveProgress * 100).round()), + textAlign: TextAlign.center, + style: theme.textTheme.labelSmall, + ), + ), + ], + ), + ), + ], const SizedBox(height: 20), ...actions, ],