mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 14:59:29 +01:00
fix: Colored background for transparent avatars
This commit is contained in:
parent
42f64393c8
commit
19fc1378fb
@ -36,18 +36,18 @@ class Avatar extends StatelessWidget {
|
||||
} else if ((name?.runes?.length ?? 0) == 1) {
|
||||
fallbackLetters = name;
|
||||
}
|
||||
final noPic = mxContent == null ||
|
||||
mxContent.toString().isEmpty ||
|
||||
mxContent.toString() == 'null';
|
||||
final textWidget = Center(
|
||||
child: Text(
|
||||
fallbackLetters,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
color: noPic ? Colors.white : null,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
);
|
||||
final noPic = mxContent == null ||
|
||||
mxContent.toString().isEmpty ||
|
||||
mxContent.toString() == 'null';
|
||||
final borderRadius = BorderRadius.circular(size / 2);
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
@ -57,7 +57,7 @@ class Avatar extends StatelessWidget {
|
||||
child: Container(
|
||||
width: size,
|
||||
height: size,
|
||||
color: name?.color,
|
||||
color: noPic ? name?.color : Theme.of(context).secondaryHeaderColor,
|
||||
child: noPic
|
||||
? textWidget
|
||||
: CachedNetworkImage(
|
||||
|
Loading…
Reference in New Issue
Block a user