From 0387b955ed8673cb7c36e0b471a473203a722e03 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 10 Mar 2024 15:18:36 +0100 Subject: [PATCH] chore: Follow up message bubble design --- lib/config/app_config.dart | 2 +- lib/pages/chat/events/message.dart | 2 +- lib/pages/chat/events/reply_content.dart | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/config/app_config.dart b/lib/config/app_config.dart index f5932b4f6..56c4a6a2f 100644 --- a/lib/config/app_config.dart +++ b/lib/config/app_config.dart @@ -64,7 +64,7 @@ abstract class AppConfig { static const String emojiFontName = 'Noto Emoji'; static const String emojiFontUrl = 'https://github.com/googlefonts/noto-emoji/'; - static const double borderRadius = 16.0; + static const double borderRadius = 18.0; static const double columnWidth = 360.0; static final Uri homeserverList = Uri( scheme: 'https', diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index 23a532f35..395aac4cd 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -101,7 +101,7 @@ class Message extends StatelessWidget { final textColor = ownMessage ? Theme.of(context).colorScheme.onPrimary - : Theme.of(context).colorScheme.onSurfaceVariant; + : Theme.of(context).colorScheme.onBackground; final rowMainAxisAlignment = ownMessage ? MainAxisAlignment.end : MainAxisAlignment.start; diff --git a/lib/pages/chat/events/reply_content.dart b/lib/pages/chat/events/reply_content.dart index 830f630a4..dc47f2542 100644 --- a/lib/pages/chat/events/reply_content.dart +++ b/lib/pages/chat/events/reply_content.dart @@ -29,9 +29,15 @@ class ReplyContent extends StatelessWidget { final displayEvent = timeline != null ? replyEvent.getDisplayEvent(timeline) : replyEvent; final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor; + final color = ownMessage + ? Theme.of(context).colorScheme.primaryContainer + : Theme.of(context).colorScheme.primary; return Material( - color: Theme.of(context).colorScheme.background.withOpacity(0.33), + color: Theme.of(context) + .colorScheme + .background + .withOpacity(ownMessage ? 0.2 : 0.33), borderRadius: borderRadius, child: Row( mainAxisSize: MainAxisSize.min, @@ -39,7 +45,7 @@ class ReplyContent extends StatelessWidget { Container( width: 3, height: fontSize * 2 + 16, - color: Theme.of(context).colorScheme.primary, + color: color, ), const SizedBox(width: 6), Flexible( @@ -56,7 +62,7 @@ class ReplyContent extends StatelessWidget { overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: FontWeight.bold, - color: Theme.of(context).colorScheme.primary, + color: color, fontSize: fontSize, ), ); @@ -72,7 +78,7 @@ class ReplyContent extends StatelessWidget { maxLines: 1, style: TextStyle( color: ownMessage - ? Theme.of(context).colorScheme.onPrimaryContainer + ? Theme.of(context).colorScheme.onPrimary : Theme.of(context).colorScheme.onBackground, fontSize: fontSize, ),