chore: Message bubble color follow up
This commit is contained in:
parent
321cc07fb8
commit
b6ea44da2e
7 changed files with 37 additions and 39 deletions
|
|
@ -147,3 +147,18 @@ extension on Brightness {
|
|||
Brightness get reversed =>
|
||||
this == Brightness.dark ? Brightness.light : Brightness.dark;
|
||||
}
|
||||
|
||||
extension BubbleColorTheme on ThemeData {
|
||||
Color get bubbleColor => brightness == Brightness.light
|
||||
? colorScheme.primary
|
||||
: colorScheme.primaryContainer;
|
||||
Color get onBubbleColor => brightness == Brightness.light
|
||||
? colorScheme.onPrimary
|
||||
: colorScheme.onPrimaryContainer;
|
||||
|
||||
Color get secondaryBubbleColor => HSLColor.fromColor(
|
||||
brightness == Brightness.light
|
||||
? colorScheme.tertiary
|
||||
: colorScheme.tertiaryContainer,
|
||||
).withSaturation(0.75).toColor();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue