AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Package | cometchat_chat_uikit |
| Key components | CometChatThread, CometChatThreadedHeader, CometChatMessageList, CometChatMessageComposer |
| Init | CometChatUIKit.init(uiKitSettings) then CometChatUIKit.login(uid) |
| Entry point | CometChatMessageList.onThreadRepliesClick opens thread view from messages |
| Sample app | GitHub |
| Related | All Guides |
Components
| Component / Class | Role |
|---|---|
CometChatThread | Main container widget for threaded messages |
CometChatThreadedHeader | Displays parent message and thread context |
CometChatMessageList | Shows messages filtered by parentMessageId |
CometChatMessageComposer | Input for composing threaded replies |
MessagesRequestBuilder | Builds request to fetch thread replies |
Integration Steps
1. Thread Trigger in Messages
Wire theonThreadRepliesClick callback on CometChatMessageList. When a user clicks the thread reply icon on any message, this fires with the parent message object.
File: messages.dart
2. Thread Screen Widget
Create the thread screen with header, message list, and composer. TheCometChatThread widget handles the complete thread UI.
File: cometchat_thread.dart
3. Thread Header and Message List
Display the parent message context and threaded replies usingCometChatThreadedHeader and CometChatMessageList with parentMessageId.
File: cometchat_thread.dart
4. Thread Composer
Add the message composer withparentMessageId to send replies in the thread context.
File: cometchat_thread.dart
5. Blocked User Handling
When a user is blocked, replace the composer with an unblock prompt. File: cometchat_thread.dartFeature Matrix
| Feature | Component / Method | File |
|---|---|---|
| Show thread option | onThreadRepliesClick | messages.dart |
| Thread screen | CometChatThread | cometchat_thread.dart |
| Thread header | CometChatThreadedHeader | cometchat_thread.dart |
| Display thread msgs | CometChatMessageList | cometchat_thread.dart |
| Compose reply | CometChatMessageComposer | cometchat_thread.dart |
| Thread controller | CometChatThreadController | cometchat_thread_controller.dart |