From 667922c9094653c82ab4e2779c52ed37ecaca7f7 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Mon, 9 Jun 2025 10:04:57 -0400 Subject: [PATCH 1/2] Add more visible activity outline color in dark mode --- .../message_token_button.dart | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/pangea/message_token_text/message_token_button.dart b/lib/pangea/message_token_text/message_token_button.dart index 7e855e223..cba22ec44 100644 --- a/lib/pangea/message_token_text/message_token_button.dart +++ b/lib/pangea/message_token_text/message_token_button.dart @@ -296,13 +296,18 @@ class MessageTokenButtonContent extends StatelessWidget { BorderRadius.circular(AppConfig.borderRadius - 4); Color _color(BuildContext context) { + final bool isLight = Theme.of(context).brightness == Brightness.light; if (activity == null) { - return Theme.of(context).colorScheme.primary; + return isLight + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.primaryContainer; } if (isActivityCompleteOrNullForToken) { return AppConfig.gold; } - return Theme.of(context).colorScheme.primary; + return isLight + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.primaryContainer; } @override @@ -384,10 +389,15 @@ class MessageTokenButtonContent extends StatelessWidget { borderRadius: _borderRadius, child: CustomPaint( painter: DottedBorderPainter( - color: Theme.of(context) - .colorScheme - .primary - .withAlpha((colorAlpha * 255).toInt()), + color: Theme.of(context).brightness == Brightness.light + ? Theme.of(context) + .colorScheme + .primary + .withAlpha((colorAlpha * 255).toInt()) + : Theme.of(context) + .colorScheme + .primaryContainer + .withAlpha((colorAlpha * 275).toInt()), borderRadius: _borderRadius, ), child: Container( From 649ecc6b15686cecbde8b2444f657e36ff03696c Mon Sep 17 00:00:00 2001 From: ggurdin Date: Mon, 9 Jun 2025 12:27:41 -0400 Subject: [PATCH 2/2] chore: simplifying changes --- .../message_token_button.dart | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/lib/pangea/message_token_text/message_token_button.dart b/lib/pangea/message_token_text/message_token_button.dart index cba22ec44..2b2624948 100644 --- a/lib/pangea/message_token_text/message_token_button.dart +++ b/lib/pangea/message_token_text/message_token_button.dart @@ -297,17 +297,13 @@ class MessageTokenButtonContent extends StatelessWidget { Color _color(BuildContext context) { final bool isLight = Theme.of(context).brightness == Brightness.light; - if (activity == null) { - return isLight - ? Theme.of(context).colorScheme.primary - : Theme.of(context).colorScheme.primaryContainer; - } - if (isActivityCompleteOrNullForToken) { - return AppConfig.gold; - } - return isLight + final defaultColor = isLight ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.primaryContainer; + + return activity != null && isActivityCompleteOrNullForToken + ? AppConfig.gold + : defaultColor; } @override @@ -382,6 +378,8 @@ class MessageTokenButtonContent extends StatelessWidget { (selectedChoice != null ? 0.4 : 0.0) + (accepted.isNotEmpty ? 0.3 : 0.0); + final theme = Theme.of(context); + return InkWell( onTap: selectedChoice != null ? () => onMatch?.call(selectedChoice!) @@ -389,15 +387,11 @@ class MessageTokenButtonContent extends StatelessWidget { borderRadius: _borderRadius, child: CustomPaint( painter: DottedBorderPainter( - color: Theme.of(context).brightness == Brightness.light - ? Theme.of(context) - .colorScheme - .primary + color: theme.brightness == Brightness.light + ? theme.colorScheme.primary .withAlpha((colorAlpha * 255).toInt()) - : Theme.of(context) - .colorScheme - .primaryContainer - .withAlpha((colorAlpha * 275).toInt()), + : theme.colorScheme.primaryContainer + .withAlpha((colorAlpha * 255).toInt()), borderRadius: _borderRadius, ), child: Container( @@ -406,9 +400,7 @@ class MessageTokenButtonContent extends StatelessWidget { width: max(width, 24.0), alignment: Alignment.center, decoration: BoxDecoration( - color: Theme.of(context) - .colorScheme - .primary + color: theme.colorScheme.primary .withAlpha((max(0, colorAlpha - 0.7) * 255).toInt()), borderRadius: _borderRadius, ),