CometChatMessageList(
user: user,
templates: [
CometChatMessageTemplate(
type: "ai_response",
category: MessageCategoryConstants.custom,
contentView: (baseMessage, context, alignment, {additionalConfigurations}) {
// Custom rendering for AI agent messages
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Color(0xFFEDEAFA),
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(Icons.smart_toy, color: Color(0xFF6852D6), size: 16),
SizedBox(width: 4),
Text("AI Assistant", style: TextStyle(
color: Color(0xFF6852D6),
fontWeight: FontWeight.bold,
fontSize: 12,
)),
],
),
SizedBox(height: 8),
Text((baseMessage as TextMessage).text),
],
),
);
},
),
],
)