mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59:26 +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) {
|
} else if ((name?.runes?.length ?? 0) == 1) {
|
||||||
fallbackLetters = name;
|
fallbackLetters = name;
|
||||||
}
|
}
|
||||||
|
final noPic = mxContent == null ||
|
||||||
|
mxContent.toString().isEmpty ||
|
||||||
|
mxContent.toString() == 'null';
|
||||||
final textWidget = Center(
|
final textWidget = Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
fallbackLetters,
|
fallbackLetters,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: noPic ? Colors.white : null,
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final noPic = mxContent == null ||
|
|
||||||
mxContent.toString().isEmpty ||
|
|
||||||
mxContent.toString() == 'null';
|
|
||||||
final borderRadius = BorderRadius.circular(size / 2);
|
final borderRadius = BorderRadius.circular(size / 2);
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
@ -57,7 +57,7 @@ class Avatar extends StatelessWidget {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
color: name?.color,
|
color: noPic ? name?.color : Theme.of(context).secondaryHeaderColor,
|
||||||
child: noPic
|
child: noPic
|
||||||
? textWidget
|
? textWidget
|
||||||
: CachedNetworkImage(
|
: CachedNetworkImage(
|
||||||
|
Loading…
Reference in New Issue
Block a user