mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-11 18:22:49 +01:00
fix: avatar color
This commit is contained in:
parent
a309cb78ac
commit
5c10e96a7b
@ -168,7 +168,7 @@ class Message extends StatelessWidget {
|
|||||||
color: (Theme.of(context).brightness ==
|
color: (Theme.of(context).brightness ==
|
||||||
Brightness.light
|
Brightness.light
|
||||||
? displayname.color
|
? displayname.color
|
||||||
: displayname.lightColor),
|
: displayname.lightColorText),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
@ -22,8 +22,13 @@ extension StringColor on String {
|
|||||||
return _colorCache[this]![0.2] ??= _getColorLight(0.2);
|
return _colorCache[this]![0.2] ??= _getColorLight(0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
Color get lightColor {
|
Color get lightColorText {
|
||||||
_colorCache[this] ??= {};
|
_colorCache[this] ??= {};
|
||||||
return _colorCache[this]![0.7] ??= _getColorLight(0.7);
|
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(
|
child: Container(
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
color:
|
color: noPic
|
||||||
noPic ? name?.lightColor : Theme.of(context).secondaryHeaderColor,
|
? name?.lightColorAvatar
|
||||||
|
: Theme.of(context).secondaryHeaderColor,
|
||||||
child: noPic
|
child: noPic
|
||||||
? textWidget
|
? textWidget
|
||||||
: MxcImage(
|
: MxcImage(
|
||||||
|
Loading…
Reference in New Issue
Block a user