AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Package | cometchat_chat_uikit |
| Framework | Flutter |
| Components | CometChatMessageHeader, CometChatMessageList, CometChatMessageComposer |
| Layout | Single chat window — no conversation list |
| Prerequisite | Complete Getting Started Steps 1–4 first |
| Pattern | Support chat, embedded widgets, focused messaging |

What You’re Building
Three components stacked vertically:- Chat header — displays recipient name, avatar, and call buttons
- Message list — real-time chat history
- Message composer — text input with media and emojis
Step 1 — Create the Chat Screen
The app fetches a user on mount and renders the message components.lib/chat_screen.dart
CometChat.getUser(uid)fetches the user object — you need a real user object, not a manually constructed one.- Pass either
userorgroupto the message components, never both.
Switching to Group Chat
To load a group chat instead, useCometChat.getGroup():