Skip to content

Commit

Permalink
chore: Make message bubble color dark also in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Dec 16, 2024
1 parent 24b4e81 commit 7b1d46a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 8 additions & 3 deletions lib/pages/chat/events/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ class Message extends StatelessWidget {
previousEvent!.senderId == event.senderId &&
previousEvent!.originServerTs.sameEnvironment(event.originServerTs);

final textColor =
ownMessage ? theme.colorScheme.onPrimary : theme.colorScheme.onSurface;
final textColor = ownMessage
? theme.brightness == Brightness.light
? theme.colorScheme.onPrimary
: theme.colorScheme.onPrimaryContainer
: theme.colorScheme.onSurface;
final rowMainAxisAlignment =
ownMessage ? MainAxisAlignment.end : MainAxisAlignment.start;

Expand Down Expand Up @@ -141,7 +144,9 @@ class Message extends StatelessWidget {
if (ownMessage) {
color = displayEvent.status.isError
? Colors.redAccent
: theme.colorScheme.primary;
: theme.brightness == Brightness.light
? theme.colorScheme.primary
: theme.colorScheme.primaryContainer;
}

final resetAnimateIn = this.resetAnimateIn;
Expand Down
10 changes: 8 additions & 2 deletions lib/pages/settings_style/settings_style_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ class SettingsStyleView extends StatelessWidget {
),
child: DecoratedBox(
decoration: BoxDecoration(
color: theme.colorScheme.primary,
color: theme.brightness == Brightness.light
? theme.colorScheme.primary
: theme.colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(
AppConfig.borderRadius,
),
Expand All @@ -227,7 +229,11 @@ class SettingsStyleView extends StatelessWidget {
child: Text(
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor',
style: TextStyle(
color: theme.colorScheme.onPrimary,
color:
theme.brightness == Brightness.light
? theme.colorScheme.onPrimary
: theme.colorScheme
.onPrimaryContainer,
fontSize: AppConfig.messageFontSize *
AppConfig.fontSizeFactor,
),
Expand Down

0 comments on commit 7b1d46a

Please sign in to comment.