AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Package | cometchat_chat_uikit |
| Key components | CometChatContacts, CometChatUsers, CometChatGroups, CometChatAvatar |
| Init | CometChatUIKit.init(uiKitSettings) then CometChatUIKit.login(uid) |
| Entry point | Avatar menu → “Create Conversation” → CometChatContacts |
| Sample app | GitHub |
| Related | All Guides |
Components
| Component / Class | Role |
|---|---|
CometChatAvatar | Displays the user avatar in the app bar |
PopupMenuButton | Shows menu options when the avatar is tapped |
CometChatContacts | UI for the “Start Conversation” screen with tabs |
CometChatContactsController | Manages tab switching and item selection |
CometChatUsers | Lists users with search and selection |
CometChatGroups | Lists groups with search and selection |
PageManager | Handles navigation to the chat screen |
Integration Steps
1. Add Avatar Menu
Show the avatar in the app bar and open a menu on tap with “Create Conversation” option. File: dashboard.dart2. Open Contacts Screen
Navigate to theCometChatContacts screen which provides tabs for Users and Groups.
File: dashboard.dart
3. Handle User/Group Selection
Wire up theonItemTap callback to navigate to the chat screen when a user or group is selected.
File: cometchat_contacts_controller.dart
4. Navigate to Chat
Open the chat screen for the selected user or group usingPageManager.
File: page_manager.dart
Feature Matrix
| Feature | Component / Method | File |
|---|---|---|
| Avatar menu | PopupMenuButton, CometChatAvatar | dashboard.dart |
| Contacts screen | CometChatContacts | dashboard.dart |
| List users | CometChatUsers | cometchat_contacts_controller.dart |
| List groups | CometChatGroups | cometchat_contacts_controller.dart |
| Handle selection | _onItemTap | page_manager.dart |
| Navigate to chat | PageManager.navigateToMessages | page_manager.dart |