diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index ce074abd..37f5dd94 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -213,7 +213,7 @@ class Message extends StatelessWidget { vertical: 4.0 * AppConfig.bubbleSizeFactor), child: ReplyContent(replyEvent, - lightText: ownMessage, + ownMessage: ownMessage, timeline: timeline), ), ), diff --git a/lib/pages/chat/events/reply_content.dart b/lib/pages/chat/events/reply_content.dart index 026e24fe..65cf3e97 100644 --- a/lib/pages/chat/events/reply_content.dart +++ b/lib/pages/chat/events/reply_content.dart @@ -9,12 +9,12 @@ import 'html_message.dart'; class ReplyContent extends StatelessWidget { final Event replyEvent; - final bool lightText; + final bool ownMessage; final Timeline? timeline; const ReplyContent( this.replyEvent, { - this.lightText = false, + this.ownMessage = false, Key? key, this.timeline, }) : super(key: key); @@ -41,9 +41,9 @@ class ReplyContent extends StatelessWidget { replyBody = HtmlMessage( html: html!, defaultTextStyle: TextStyle( - color: lightText - ? Colors.white - : Theme.of(context).textTheme.bodyText2!.color, + color: ownMessage + ? Theme.of(context).colorScheme.onPrimary + : Theme.of(context).colorScheme.onBackground, fontSize: fontSize, ), maxLines: 1, @@ -60,9 +60,9 @@ class ReplyContent extends StatelessWidget { overflow: TextOverflow.ellipsis, maxLines: 1, style: TextStyle( - color: lightText - ? Colors.white - : Theme.of(context).textTheme.bodyText2!.color, + color: ownMessage + ? Theme.of(context).colorScheme.onPrimary + : Theme.of(context).colorScheme.onBackground, fontSize: fontSize, ), ); @@ -73,7 +73,9 @@ class ReplyContent extends StatelessWidget { Container( width: 3, height: fontSize * 2 + 6, - color: lightText ? Colors.white : Theme.of(context).primaryColor, + color: ownMessage + ? Theme.of(context).colorScheme.onPrimary + : Theme.of(context).colorScheme.onBackground, ), const SizedBox(width: 6), Flexible( @@ -87,8 +89,9 @@ class ReplyContent extends StatelessWidget { overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: FontWeight.bold, - color: - lightText ? Colors.white : Theme.of(context).primaryColor, + color: ownMessage + ? Theme.of(context).colorScheme.onPrimary + : Theme.of(context).colorScheme.onBackground, fontSize: fontSize, ), ), diff --git a/lib/widgets/unread_badge_back_button.dart b/lib/widgets/unread_badge_back_button.dart index c0970dcb..679e28e7 100644 --- a/lib/widgets/unread_badge_back_button.dart +++ b/lib/widgets/unread_badge_back_button.dart @@ -35,15 +35,17 @@ class UnreadBadgeBackButton extends StatelessWidget { padding: const EdgeInsets.all(4), margin: const EdgeInsets.only(bottom: 4, right: 8), decoration: BoxDecoration( - color: Theme.of(context).primaryColor, + color: Theme.of(context).colorScheme.primaryContainer, borderRadius: BorderRadius.circular(AppConfig.borderRadius), ), child: Text( '$unreadCount', - style: const TextStyle( + style: TextStyle( fontSize: 12, - color: Colors.white, + color: Theme.of(context) + .colorScheme + .onPrimaryContainer, ), ), ),