AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Package | cometchat_chat_uikit |
| Key components | CometchatUserInfo — uses CometChatUIKit.blockUsers() / CometChatUIKit.unblockUsers() SDK methods |
| Init | CometChatUIKit.init(uiKitSettings) then CometChatUIKit.login(uid) |
| Events | Block/unblock state managed via user.blockedByMe property |
| UI helpers | CometChatUserInfoController, confirmation dialogs |
| Sample app | GitHub |
| Related | All Guides |
Components
| Component / Class | Role |
|---|---|
CometchatUserInfo | User profile screen with block/unblock controls |
CometChatUserInfoController | Controller managing block/unblock state and actions |
CometChatUIKit.blockUsers() | SDK method to block specific users |
CometChatUIKit.unblockUsers() | SDK method to unblock previously blocked users |
user.blockedByMe | Property indicating if current user blocked this user |
Integration Steps
1. Navigate to User Info
Open the user info screen from the messages view when tapping the user profile or info icon. File: messages.dart2. Block User
Call the block user dialog which usesCometChatUIKit.blockUsers() with the target UID. On success, update the UI to show the blocked state.
File: cometchat_user_info.dart
3. Unblock User
CallCometChatUIKit.unblockUsers() with the target UID. On success, restore the UI to allow messaging.
File: cometchat_user_info_controller.dart
4. Blocked State Banner
Display a warning banner when viewing a blocked user’s profile. File: cometchat_user_info.dart5. Composer Blocked State
When a user is blocked, the composer in thread/message views is replaced with an unblock prompt. File: cometchat_thread.dartFeature Matrix
| Feature | Component / Method | File |
|---|---|---|
| User info screen | CometchatUserInfo | cometchat_user_info.dart |
| Block user | blockUserDialog() | cometchat_user_info_controller.dart |
| Unblock user | unblockUserDialog() | cometchat_user_info_controller.dart |
| Check blocked status | user.blockedByMe | cometchat_user_info.dart |
| Blocked banner | Warning container | cometchat_user_info.dart |
| Blocked composer | _buildBlockedUserSection() | cometchat_thread.dart |
Next Steps
Users
Display and manage user lists.
Message Composer
Customize the message input component.
All Guides
Browse all feature and formatter guides.
Sample App
Full working sample application on GitHub.