From 9ef78ad6701278a090132bd87c4d0f47357f5f5d Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Fri, 13 Nov 2026 17:41:31 +0800 Subject: [PATCH] =?UTF-8?q?style(reward):=20=E4=BC=98=E5=8C=96=E5=A5=96?= =?UTF-8?q?=E5=8A=B1=E4=B8=AD=E5=BF=83=E9=87=91=E5=B8=81=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/reward/reward_tasks_view.dart | 2 +- lib/pages/reward/reward_visuals.dart | 66 ++++++++++++++++++------- test/reward/reward_page_test.dart | 1 + 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/lib/pages/reward/reward_tasks_view.dart b/lib/pages/reward/reward_tasks_view.dart index 25b11ba..7a95e2d 100644 --- a/lib/pages/reward/reward_tasks_view.dart +++ b/lib/pages/reward/reward_tasks_view.dart @@ -149,7 +149,7 @@ class _Balance extends StatelessWidget { ), ), const SizedBox(width: AppDimens.spaceSm), - const RewardCoinIcon(size: 32), + const RewardCoinIcon(key: Key('reward-balance-coin-icon'), size: 32), ], ); if (onOpenWallet == null) return content; diff --git a/lib/pages/reward/reward_visuals.dart b/lib/pages/reward/reward_visuals.dart index 60ccda5..d854f5e 100644 --- a/lib/pages/reward/reward_visuals.dart +++ b/lib/pages/reward/reward_visuals.dart @@ -7,6 +7,10 @@ import '../../core/theme/app_colors.dart'; const double _coinInnerInsetRatio = 0.1; const double _coinLetterRatio = 0.46; +const double _coinHighlightRatio = 0.18; +const double _coinHighlightOpacity = 0.54; +const double _coinLetterShadowBlur = 1.5; +const double _coinLetterShadowOffset = 0.8; const double _taskIconSize = 46; const double _taskIconRadius = 12; const double _taskGlyphSize = 24; @@ -20,6 +24,8 @@ const Color _coinOuter = Color(0xFFF6B84E); const Color _coinInnerStart = Color(0xFFFFD98B); const Color _coinInnerEnd = Color(0xFFE39B31); const Color _coinBorder = Color(0xFFFFE0A1); +const Color _coinHighlight = Color(0xFFFFF4CC); +const Color _coinLetterShadow = Color(0xFFB66A16); const Color _taskIconStart = Color(0xFF4C171E); const Color _taskIconEnd = Color(0xFF281014); const Color _taskIconSurface = Color(0xFF202022); @@ -42,26 +48,52 @@ class RewardCoinIcon extends StatelessWidget { color: _coinOuter, boxShadow: [BoxShadow(color: Color(0x4DF6B84E), blurRadius: 6)], ), - child: Container( + child: Stack( alignment: Alignment.center, - decoration: BoxDecoration( - shape: BoxShape.circle, - gradient: const LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [_coinInnerStart, _coinInnerEnd], + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: const LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [_coinInnerStart, _coinInnerEnd], + ), + border: Border.all(color: _coinBorder), + ), ), - border: Border.all(color: _coinBorder), - ), - child: Text( - 'N', - style: TextStyle( - color: AppColors.textPrimary, - fontSize: size * _coinLetterRatio, - fontWeight: FontWeight.w900, - height: 1, + Positioned( + top: size * 0.12, + left: size * 0.18, + child: Container( + width: size * _coinHighlightRatio, + height: size * _coinHighlightRatio, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _coinHighlight.withValues(alpha: _coinHighlightOpacity), + ), + ), ), - ), + Text( + 'N', + style: TextStyle( + color: AppColors.textPrimary, + fontSize: size * _coinLetterRatio, + fontWeight: FontWeight.w900, + height: 1, + shadows: const [ + Shadow( + color: _coinLetterShadow, + blurRadius: _coinLetterShadowBlur, + offset: Offset( + _coinLetterShadowOffset, + _coinLetterShadowOffset, + ), + ), + ], + ), + ), + ], ), ); } diff --git a/test/reward/reward_page_test.dart b/test/reward/reward_page_test.dart index c5ba098..c409270 100644 --- a/test/reward/reward_page_test.dart +++ b/test/reward/reward_page_test.dart @@ -48,6 +48,7 @@ void main() { expect(find.byKey(const Key('reward-back-button')), findsOneWidget); expect(find.byKey(const Key('reward-help-button')), findsOneWidget); expect(find.byKey(const Key('reward-balance')), findsOneWidget); + expect(find.byKey(const Key('reward-balance-coin-icon')), findsOneWidget); expect(find.byKey(const Key('reward-checkin-card')), findsOneWidget); expect(find.byKey(const Key('reward-checkin-action')), findsOneWidget); expect(find.byKey(const Key('reward-section-DAILY')), findsOneWidget);