chore: Follow up color fixes

This commit is contained in:
Christian Pauly 2022-05-27 15:13:24 +02:00
parent 71503abd95
commit aa14ce71b6
3 changed files with 20 additions and 15 deletions

View File

@ -213,7 +213,7 @@ class Message extends StatelessWidget {
vertical: 4.0 *
AppConfig.bubbleSizeFactor),
child: ReplyContent(replyEvent,
lightText: ownMessage,
ownMessage: ownMessage,
timeline: timeline),
),
),

View File

@ -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,
),
),

View File

@ -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,
),
),
),