From 4c5002e4a4c6d28f2a9ce2a9fcc56f5b2846dee8 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Wed, 5 Feb 2025 15:14:54 -0500 Subject: [PATCH] chore: update link text color in dark mode --- lib/pages/chat/events/message.dart | 4 +++- lib/pangea/activity_planner/activity_plan_message.dart | 5 ++++- lib/pangea/toolbar/widgets/message_audio_card.dart | 5 ++++- lib/pangea/toolbar/widgets/message_token_text.dart | 4 +++- lib/pangea/toolbar/widgets/overlay_message.dart | 4 +++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index 1c10c6149d..b9843f77ca 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -171,7 +171,9 @@ class Message extends StatelessWidget { // ? theme.colorScheme.primaryFixed // : theme.colorScheme.onTertiaryContainer // : theme.colorScheme.primary; - final linkColor = theme.colorScheme.primary; + final linkColor = theme.brightness == Brightness.light + ? theme.colorScheme.primary + : theme.colorScheme.onPrimary; // Pangea# final rowMainAxisAlignment = diff --git a/lib/pangea/activity_planner/activity_plan_message.dart b/lib/pangea/activity_planner/activity_plan_message.dart index 434bdade0d..397c944079 100644 --- a/lib/pangea/activity_planner/activity_plan_message.dart +++ b/lib/pangea/activity_planner/activity_plan_message.dart @@ -120,7 +120,10 @@ class ActivityPlanMessage extends StatelessWidget { controller: controller, immersionMode: false, timeline: timeline, - linkColor: theme.colorScheme.primary, + linkColor: + theme.brightness == Brightness.light + ? theme.colorScheme.primary + : theme.colorScheme.onPrimary, ), if (event.hasAggregatedEvents( timeline, diff --git a/lib/pangea/toolbar/widgets/message_audio_card.dart b/lib/pangea/toolbar/widgets/message_audio_card.dart index febce674c0..d5dcea7f17 100644 --- a/lib/pangea/toolbar/widgets/message_audio_card.dart +++ b/lib/pangea/toolbar/widgets/message_audio_card.dart @@ -205,7 +205,10 @@ class MessageAudioCardState extends State { chatController: widget.overlayController.widget.chatController, overlayController: widget.overlayController, - linkColor: Theme.of(context).colorScheme.primary, + linkColor: + Theme.of(context).brightness == Brightness.light + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.onPrimary, ) : const CardErrorWidget( error: "Null audio file in message_audio_card", diff --git a/lib/pangea/toolbar/widgets/message_token_text.dart b/lib/pangea/toolbar/widgets/message_token_text.dart index 8ba366f7a7..d3e72dbca7 100644 --- a/lib/pangea/toolbar/widgets/message_token_text.dart +++ b/lib/pangea/toolbar/widgets/message_token_text.dart @@ -238,7 +238,9 @@ class MessageTextWidget extends StatelessWidget { ), linkStyle: TextStyle( decoration: TextDecoration.underline, - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).brightness == Brightness.light + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.onPrimary, ), onOpen: (url) => UrlLauncher(context, url.url).launchUrl(), diff --git a/lib/pangea/toolbar/widgets/overlay_message.dart b/lib/pangea/toolbar/widgets/overlay_message.dart index 0abf3da0b5..87578108ff 100644 --- a/lib/pangea/toolbar/widgets/overlay_message.dart +++ b/lib/pangea/toolbar/widgets/overlay_message.dart @@ -190,7 +190,9 @@ class OverlayMessage extends StatelessWidget { prevEvent: prevEvent, borderRadius: borderRadius, timeline: timeline, - linkColor: theme.colorScheme.primary, + linkColor: theme.brightness == Brightness.light + ? theme.colorScheme.primary + : theme.colorScheme.onPrimary, ), if (event.hasAggregatedEvents( timeline,