chat info not finished
This commit is contained in:
@@ -292,61 +292,67 @@ class MessageBubble extends StatelessWidget {
|
||||
String? senderAvatar = ContactCache.getAvatar(message.senderId);
|
||||
String? displaySender = ContactCache.get(message.senderId);
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: isMe ? 12 : 12,
|
||||
right: isMe ? 12 : 12,
|
||||
top: topMargin,
|
||||
bottom: bottomMargin,
|
||||
),
|
||||
child: Align(
|
||||
child: Row(
|
||||
mainAxisAlignment: isMe ? MainAxisAlignment.end : MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
if (!isMe && chatType == "CHAT" && nextMessage?.senderId != message.senderId && prevMessage?.senderId == message.senderId)
|
||||
...(senderAvatar != null && senderAvatar.isNotEmpty)
|
||||
? [
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundImage: NetworkImage(senderAvatar),
|
||||
backgroundColor: cs.primaryContainer,
|
||||
)
|
||||
]
|
||||
: [
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: cs.primaryContainer,
|
||||
child: Text(
|
||||
displaySender != null && displaySender.isNotEmpty
|
||||
? displaySender[0].toUpperCase()
|
||||
: '?',
|
||||
style: TextStyle(fontSize: 9, color: cs.onPrimaryContainer),
|
||||
),
|
||||
)
|
||||
]
|
||||
else if (!isMe && chatType != "CHAT")
|
||||
SizedBox(width: 0)
|
||||
else if (!isMe)
|
||||
CircleAvatar(radius: 15, backgroundColor: Color(0x00000000)),
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: MediaQuery.of(context).size.width * 0.75,
|
||||
return GestureDetector(
|
||||
// TODO: действия с сообщением
|
||||
onTap: () => print("test"),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: isMe ? 12 : 12,
|
||||
right: isMe ? 12 : 12,
|
||||
top: topMargin,
|
||||
bottom: bottomMargin,
|
||||
),
|
||||
child: Align(
|
||||
child: Row(
|
||||
mainAxisAlignment: isMe ? MainAxisAlignment.end : MainAxisAlignment.start,
|
||||
spacing: 8,
|
||||
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
if (!isMe && chatType == "CHAT" && nextMessage?.senderId != message.senderId && prevMessage?.senderId == message.senderId)
|
||||
...(senderAvatar != null && senderAvatar.isNotEmpty)
|
||||
? [
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundImage: NetworkImage(senderAvatar),
|
||||
backgroundColor: cs.primaryContainer,
|
||||
)
|
||||
]
|
||||
: [
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: cs.primaryContainer,
|
||||
child: Text(
|
||||
displaySender != null && displaySender.isNotEmpty
|
||||
? displaySender[0].toUpperCase()
|
||||
: '?',
|
||||
style: TextStyle(fontSize: 9, color: cs.onPrimaryContainer),
|
||||
),
|
||||
)
|
||||
]
|
||||
else if (!isMe && chatType != "CHAT")
|
||||
SizedBox(width: 0)
|
||||
else if (!isMe)
|
||||
CircleAvatar(radius: 15, backgroundColor: Color(0x00000000)),
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: MediaQuery.of(context).size.width * 0.75,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isMe
|
||||
? (isDark ? const Color(0xFF2C5F8D) : const Color(0xFF007AFF))
|
||||
: (isDark
|
||||
? cs.surfaceContainerHighest
|
||||
: const Color(0xFFE9E9EB)),
|
||||
borderRadius: _borderRadius,
|
||||
),
|
||||
padding: padding,
|
||||
child: _buildContent(context),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isMe
|
||||
? (isDark ? const Color(0xFF2C5F8D) : const Color(0xFF007AFF))
|
||||
: (isDark
|
||||
? cs.surfaceContainerHighest
|
||||
: const Color(0xFFE9E9EB)),
|
||||
borderRadius: _borderRadius,
|
||||
),
|
||||
padding: padding,
|
||||
child: _buildContent(context),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user