From f9d14a4f75b2f1672347c360e0cfd9ac55de0fb4 Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Thu, 25 Sep 2025 11:33:32 -0400 Subject: [PATCH] chore: add gold shimmer to active token practice buttons (#4131) --- .../token_practice_button.dart | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/lib/pangea/message_token_text/token_practice_button.dart b/lib/pangea/message_token_text/token_practice_button.dart index 22fdebcfe..8a0827a66 100644 --- a/lib/pangea/message_token_text/token_practice_button.dart +++ b/lib/pangea/message_token_text/token_practice_button.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:collection/collection.dart'; import 'package:material_symbols_icons/symbols.dart'; +import 'package:shimmer/shimmer.dart'; import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/pangea/common/utils/error_handler.dart'; @@ -391,15 +392,23 @@ class MessageTokenButtonContent extends StatelessWidget { color: textColor.withAlpha((colorAlpha * 255).toInt()), borderRadius: _borderRadius, ), - child: Container( - height: height, - padding: const EdgeInsets.only(top: 10.0), - width: max(width, 24.0), - alignment: Alignment.center, - decoration: BoxDecoration( - color: theme.colorScheme.primary - .withAlpha((max(0, colorAlpha - 0.7) * 255).toInt()), - borderRadius: _borderRadius, + child: Shimmer.fromColors( + enabled: selectedChoice != null, + baseColor: selectedChoice != null + ? AppConfig.gold.withAlpha(20) + : Colors.transparent, + highlightColor: selectedChoice != null + ? AppConfig.gold.withAlpha(50) + : Colors.transparent, + child: Container( + height: height, + padding: const EdgeInsets.only(top: 10.0), + width: max(width, 24.0), + alignment: Alignment.center, + decoration: BoxDecoration( + color: theme.colorScheme.surface, + borderRadius: _borderRadius, + ), ), ), ),