mirror of
https://github.com/krille-chan/fluffychat
synced 2024-10-05 13:52:46 +00:00
fix: avatar color
This commit is contained in:
parent
704ee5ef9c
commit
d226bf6020
3 changed files with 10 additions and 4 deletions
|
@ -168,7 +168,7 @@ class Message extends StatelessWidget {
|
|||
color: (Theme.of(context).brightness ==
|
||||
Brightness.light
|
||||
? displayname.color
|
||||
: displayname.lightColor),
|
||||
: displayname.lightColorText),
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
|
|
@ -22,8 +22,13 @@ extension StringColor on String {
|
|||
return _colorCache[this]![0.2] ??= _getColorLight(0.2);
|
||||
}
|
||||
|
||||
Color get lightColor {
|
||||
Color get lightColorText {
|
||||
_colorCache[this] ??= {};
|
||||
return _colorCache[this]![0.7] ??= _getColorLight(0.7);
|
||||
}
|
||||
|
||||
Color get lightColorAvatar {
|
||||
_colorCache[this] ??= {};
|
||||
return _colorCache[this]![0.4] ??= _getColorLight(0.4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,8 +58,9 @@ class Avatar extends StatelessWidget {
|
|||
child: Container(
|
||||
width: size,
|
||||
height: size,
|
||||
color:
|
||||
noPic ? name?.lightColor : Theme.of(context).secondaryHeaderColor,
|
||||
color: noPic
|
||||
? name?.lightColorAvatar
|
||||
: Theme.of(context).secondaryHeaderColor,
|
||||
child: noPic
|
||||
? textWidget
|
||||
: MxcImage(
|
||||
|
|
Loading…
Reference in a new issue