AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Package | cometchat_chat_uikit |
| Framework | Flutter |
| Components | CometChatConversations, CometChatMessageHeader, CometChatMessageList, CometChatMessageComposer |
| Layout | Two-panel — conversation list + message view with Navigator push |
| Prerequisite | Complete Getting Started Steps 1–4 first |
| Pattern | WhatsApp, Telegram, Slack |

What You’re Building
Two screens working together:- Conversation list — shows all active conversations (users and groups)
- Message screen — header + messages + composer for the selected conversation
Step 1 — Create the Conversations Screen
TheCometChatConversations widget displays all conversations. Tapping one navigates to the message screen.
lib/conversations_page.dart
onItemTapfires when a conversation is tapped, passing theConversationobject.conversationWithreturns either aUserorGroup— pass the correct one to the message screen.
Step 2 — Create the Messages Screen
The message screen combines header, message list, and composer.lib/messages_screen.dart
| Component | Purpose |
|---|---|
CometChatMessageHeader | Shows conversation title, avatar, and call buttons |
CometChatMessageList | Displays messages with real-time updates |
CometChatMessageComposer | Input field for text, media, and attachments |