forked from eatvio/eatvio_app
fix: chat
This commit is contained in:
@@ -46,15 +46,13 @@ class _ChatEntryWidgetState extends State<ChatEntryWidget> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
widget.chatRoom.users.toChatUser.profilePhotoPath == null
|
||||
? buildAvatarByUsername(widget.chatRoom.users.toChatUser.name)
|
||||
: CircleAvatar(
|
||||
radius: 24,
|
||||
backgroundImage: NetworkImage(
|
||||
widget.chatRoom.users.toChatUser.profilePhotoUrl,
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
),
|
||||
CircleAvatar(
|
||||
radius: 24,
|
||||
backgroundImage: NetworkImage(
|
||||
widget.chatRoom.users.toChatUser.profilePhotoUrl,
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -95,25 +93,4 @@ class _ChatEntryWidgetState extends State<ChatEntryWidget> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
buildAvatarByUsername(String username) {
|
||||
username = username.trim();
|
||||
return Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFEBF4FF),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Text(
|
||||
username.split(' ').first[0] + username.split(' ')[1][0],
|
||||
style: TextStyle(
|
||||
color: Color(0xFF7F9CF5),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user