AI Agent Component Spec
AI Agent Component Spec
Where It Fits
CometChatConversations is a sidebar list widget. It renders recent conversations and emits the selected Conversation via onItemTap. Wire it to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer to build a standard two-panel chat layout.
- Dart

Minimal Render
- Dart

Navigator.push:
Filtering Conversations
Pass aConversationsRequestBuilder to conversationsRequestBuilder. Pass the builder instance — not the result of .build().
- Dart
Filter Recipes
| Recipe | Code |
|---|---|
| Only user conversations | ConversationsRequestBuilder()..conversationType = "user" |
| Only group conversations | ConversationsRequestBuilder()..conversationType = "group" |
| Limit to 10 per page | ConversationsRequestBuilder()..limit = 10 |
| With specific tags | ConversationsRequestBuilder()..tags = ["vip"] |
| With user and group tags | ConversationsRequestBuilder()..withUserAndGroupTags = true |
| Include blocked users | ConversationsRequestBuilder()..includeBlockedUsers = true |
| Search conversations | ConversationsRequestBuilder()..searchKeyword = "hello" |
| Unread only | ConversationsRequestBuilder()..unread = true |
ConversationsRequestBuilder Properties
| Property | Description | Code |
|---|---|---|
limit | Number of conversations to fetch per request. Maximum 50. | ..limit = 30 |
conversationType | Filter by conversation type: "user" or "group". If not set, returns both. | ..conversationType = "user" |
withTags | Include tags associated with conversations. Default false. | ..withTags = true |
tags | Filter conversations by specific tags. | ..tags = ["archived", "vip"] |
withUserAndGroupTags | Include user/group tags in the Conversation object. Default false. | ..withUserAndGroupTags = true |
includeBlockedUsers | Include conversations with blocked users. Default false. | ..includeBlockedUsers = true |
withBlockedInfo | Include blocked info in the ConversationWith object. Default false. | ..withBlockedInfo = true |
searchKeyword | Search conversations by user or group name. Requires Advanced plan. | ..searchKeyword = "John" |
unread | Fetch only unread conversations. Requires Advanced plan. | ..unread = true |
build() | Builds and returns a ConversationsRequest object. | .build() |
Actions and Events
Callback Props
onItemTap
Fires when a conversation row is tapped. Primary navigation hook — set the active conversation and render the message view.- Dart
onItemLongPress
Fires when a conversation row is long-pressed. Useful for showing context menus or custom actions.- Dart
onSelection
Fires when conversations are selected in multi-select mode. RequiresselectionMode to be set.
- Dart
onError
Fires on internal errors (network failure, auth issue, SDK exception).- Dart
onBack
Fires when the back button is pressed.- Dart
onLoad
Fires when the conversation list is successfully loaded.- Dart
onEmpty
Fires when the conversation list is empty.- Dart
Global UI Events
CometChatConversationEvents emits events subscribable from anywhere in the application. Add a listener in initState and remove it in dispose.
| Event | Fires when | Payload |
|---|---|---|
ccConversationDeleted | A conversation is deleted from the list | Conversation |
- Dart
SDK Events (Real-Time, Automatic)
The component listens to these SDK events internally. No manual attachment needed unless additional side effects are required.| SDK Listener | Internal behavior |
|---|---|
onTextMessageReceived / onMediaMessageReceived / onCustomMessageReceived | Moves conversation to top, updates last message preview and unread count |
onTypingStarted / onTypingEnded | Shows/hides typing indicator in the subtitle |
onMessagesDelivered / onMessagesRead | Updates receipt ticks (unless receiptsVisibility: false) |
onUserOnline / onUserOffline | Updates online/offline status dot (unless usersStatusVisibility: false) |
onGroupMemberJoined / onGroupMemberLeft / onGroupMemberKicked / onGroupMemberBanned / onMemberAddedToGroup | Updates group conversation metadata |
Custom View Slots
Each slot replaces a section of the default UI. Slots that accept a conversation parameter receive theConversation object for that row.
| Slot | Signature | Replaces |
|---|---|---|
listItemView | Widget Function(Conversation) | Entire list item row |
leadingView | Widget? Function(BuildContext, Conversation) | Avatar / left section |
titleView | Widget? Function(BuildContext, Conversation) | Name / title text |
subtitleView | Widget? Function(BuildContext, Conversation) | Last message preview |
trailingView | Widget? Function(Conversation) | Timestamp / badge / right section |
loadingStateView | WidgetBuilder | Loading spinner |
emptyStateView | WidgetBuilder | Empty state |
errorStateView | WidgetBuilder | Error state |
setOptions | List<CometChatOption>? Function(Conversation, Controller, BuildContext) | Context menu actions (replaces default) |
addOptions | List<CometChatOption>? Function(Conversation, Controller, BuildContext) | Context menu actions (adds to default) |
listItemView
Replace the entire list item row.
- Dart
- Dart
leadingView
Replace the avatar / left section. Typing-aware avatar example.
- Dart
titleView
Replace the name / title text. Inline user status example.
- Dart
subtitleView
Replace the last message preview text.
- Dart
trailingView
Replace the timestamp / badge / right section. Relative time badge example.
- Dart
setOptions
Replace the context menu / long-press actions on each conversation item.
- Dart
addOptions
Add to the existing context menu actions without removing defaults.
- Dart
appBarOptions
Add custom widgets to the app bar.
- Dart
- Dart
Styling
SetCometChatConversationsStyle to customize the appearance.
- Dart

Style Properties
| Property | Type | Description |
|---|---|---|
backgroundColor | Color | Background color of the component |
border | Border | Border for the widget |
borderRadius | BorderRadiusGeometry | Border radius for the widget |
titleTextColor | Color | Color of the header title |
titleTextStyle | TextStyle | Style for the header title |
backIconColor | Color | Back button icon color |
searchBackgroundColor | Color | Background color of search box |
searchBorder | BorderSide | Border for search box |
searchBorderRadius | BorderRadius | Border radius for search box |
searchPlaceHolderTextColor | Color | Placeholder text color in search |
searchPlaceHolderTextStyle | TextStyle | Placeholder text style in search |
searchIconColor | Color | Search icon color |
separatorColor | Color | Color of list item separators |
separatorHeight | double | Height of list item separators |
emptyStateTextColor | Color | Text color for empty state title |
emptyStateTextStyle | TextStyle | Text style for empty state title |
emptyStateSubTitleTextColor | Color | Text color for empty state subtitle |
emptyStateSubTitleTextStyle | TextStyle | Text style for empty state subtitle |
errorStateTextColor | Color | Text color for error state title |
errorStateTextStyle | TextStyle | Text style for error state title |
errorStateSubTitleTextColor | Color | Text color for error state subtitle |
errorStateSubTitleTextStyle | TextStyle | Text style for error state subtitle |
itemTitleTextColor | Color | Text color for conversation item title |
itemTitleTextStyle | TextStyle | Text style for conversation item title |
itemSubtitleTextColor | Color | Text color for conversation item subtitle |
itemSubtitleTextStyle | TextStyle | Text style for conversation item subtitle |
messageTypeIconColor | Color | Icon color for message type indicators |
avatarStyle | CometChatAvatarStyle | Style for avatars |
badgeStyle | CometChatBadgeStyle | Style for unread badges |
receiptStyle | CometChatMessageReceiptStyle | Style for message receipts |
statusIndicatorStyle | CometChatStatusIndicatorStyle | Style for online status indicator |
dateStyle | CometChatDateStyle | Style for date/time display |
typingIndicatorStyle | CometChatTypingIndicatorStyle | Style for typing indicator |
mentionsStyle | CometChatMentionsStyle | Style for @mentions |
deleteConversationDialogStyle | CometChatConfirmDialogStyle | Style for delete confirmation dialog |
privateGroupIconBackground | Color | Background color for private group icon |
protectedGroupIconBackground | Color | Background color for protected group icon |
submitIconColor | Color | Color for submit icon in selection mode |
checkBoxBackgroundColor | Color | Background color for selection checkbox |
checkBoxCheckedBackgroundColor | Color | Background color when checkbox is checked |
checkBoxBorder | BorderSide | Border for selection checkbox |
checkBoxBorderRadius | BorderRadiusGeometry | Border radius for selection checkbox |
checkboxSelectedIconColor | Color | Icon color when checkbox is selected |
listItemSelectedBackgroundColor | Color | Background color for selected list items |
Common Patterns
Custom empty state with CTA
- Dart
Hide all chrome — minimal list
- Dart
Conversations with search
- Dart
Custom date pattern

- Dart
Text formatters
Configure text formatters for the conversation subtitle. See CometChatMentionsFormatter for mention formatting.
- Dart
Accessibility
The component renders a scrollable list of interactive items. Each conversation row is tappable and responds to both tap and long-press gestures. The context menu (options) is accessible via long-press. The unread badge count is exposed as text content. Avatar images include the conversation name for accessibility. For screen readers, the conversation list is rendered as a semantic list using Flutter’s built-in accessibility features. Status indicators (online/offline, group type icons) use visual icons — consider providing customSemantics widgets via leadingView if screen reader descriptions are needed for these visual indicators.
When using selection mode, checkboxes are rendered with proper accessibility labels. The component respects system accessibility settings including text scaling and high contrast modes.
Props
All props are optional. Sorted alphabetically.activateSelection
Controls when selection mode activates.| Type | ActivateSelection |
| Default | null |
ActivateSelection.onClick, ActivateSelection.onLongClick
addOptions
Adds to the current list of actions available on long press.| Type | List<CometChatOption>? Function(Conversation, CometChatConversationsController, BuildContext) |
| Default | null |
appBarOptions
List of widgets to display in the app bar.| Type | List<Widget> |
| Default | null |
backButton
Custom back button widget.| Type | Widget |
| Default | Built-in back arrow |
conversationsRequestBuilder
Controls which conversations load and in what order.| Type | ConversationsRequestBuilder |
| Default | SDK default (30 per page) |
.build().
conversationsProtocol
Custom protocol for fetching conversations.| Type | ConversationsBuilderProtocol |
| Default | null |
conversationsStyle
Style configuration for the component.| Type | CometChatConversationsStyle |
| Default | CometChatConversationsStyle() |
customSoundForMessages
Path to a custom audio file for incoming message notifications.| Type | String |
| Default | Built-in sound |
datePattern
Custom date format function for conversation timestamps.| Type | String Function(Conversation) |
| Default | Built-in date formatting |
deleteConversationOptionVisibility
Controls visibility of delete option in context menu.| Type | bool |
| Default | true |
deliveredIcon
Custom icon for delivered message receipts.| Type | Widget |
| Default | Built-in delivered icon |
disableSoundForMessages
Disables notification sound for incoming messages.| Type | bool |
| Default | false |
emptyStateView
Custom widget displayed when there are no conversations.| Type | WidgetBuilder |
| Default | Built-in empty state |
errorStateView
Custom widget displayed when an error occurs.| Type | WidgetBuilder |
| Default | Built-in error state |
hideError: true.
groupTypeVisibility
Controls visibility of group type icon (public/private/password).| Type | bool |
| Default | true |
hideAppbar
Hides the entire app bar.| Type | bool |
| Default | false |
hideError
Hides the default and custom error views.| Type | bool |
| Default | false |
hideSearch
Hides the search bar in the app bar.| Type | bool |
| Default | false |
leadingView
Custom renderer for the avatar / left section.| Type | Widget? Function(BuildContext, Conversation) |
| Default | Built-in avatar |
null to use the default avatar.
listItemView
Custom renderer for the entire list item row.| Type | Widget Function(Conversation) |
| Default | Built-in list item |
loadingStateView
Custom widget displayed during loading state.| Type | WidgetBuilder |
| Default | Built-in shimmer |
mentionAllLabel
Custom label for group mentions (@channel, @everyone).| Type | String |
| Default | null |
mentionAllLabelId
Custom label ID for group mentions.| Type | String |
| Default | null |
onBack
Callback fired when the back button is pressed.| Type | VoidCallback |
| Default | null |
onEmpty
Callback fired when the conversation list is empty.| Type | OnEmpty |
| Default | null |
onError
Callback fired when the component encounters an error.| Type | OnError |
| Default | null |
onItemLongPress
Callback fired when a conversation row is long-pressed.| Type | Function(Conversation) |
| Default | null |
onItemTap
Callback fired when a conversation row is tapped.| Type | Function(Conversation) |
| Default | null |
onLoad
Callback fired when the conversation list is loaded.| Type | OnLoad<Conversation> |
| Default | null |
onSearchTap
Callback fired when the search box is tapped.| Type | GestureTapCallback |
| Default | null |
searchReadOnly: true to work properly.
onSelection
Callback fired when conversations are selected/deselected.| Type | Function(List<Conversation>?) |
| Default | null |
selectionMode to be set.
privateGroupIcon
Custom icon for private group indicator.| Type | Widget |
| Default | Built-in lock icon |
protectedGroupIcon
Custom icon for password-protected group indicator.| Type | Widget |
| Default | Built-in lock icon |
readIcon
Custom icon for read message receipts.| Type | Widget |
| Default | Built-in read icon |
receiptsVisibility
Controls visibility of message read/delivery receipts.| Type | bool |
| Default | true |
scrollController
Custom scroll controller for the list.| Type | ScrollController |
| Default | null |
searchBoxIcon
Custom prefix icon for the search box.| Type | Widget |
| Default | Built-in search icon |
searchContentPadding
Padding for search box content.| Type | EdgeInsetsGeometry |
| Default | null |
searchPadding
Padding for the search box.| Type | EdgeInsetsGeometry |
| Default | null |
searchReadOnly
Makes the search box read-only (tap only).| Type | bool |
| Default | false |
selectionMode
Enables single or multi-select mode.| Type | SelectionMode |
| Default | null |
SelectionMode.single, SelectionMode.multiple, SelectionMode.none
Must pair with onSelection to capture selections.
sentIcon
Custom icon for sent message receipts.| Type | Widget |
| Default | Built-in sent icon |
setOptions
Replaces the list of actions available on long press.| Type | List<CometChatOption>? Function(Conversation, CometChatConversationsController, BuildContext) |
| Default | null |
showBackButton
Shows the back button in the app bar.| Type | bool |
| Default | false |
subtitleView
Custom renderer for the last message preview.| Type | Widget? Function(BuildContext, Conversation) |
| Default | Built-in subtitle |
textFormatters
Custom text formatters for the conversation subtitle.| Type | List<CometChatTextFormatter> |
| Default | Default formatters from data source |
title
Custom title text for the app bar.| Type | String |
| Default | ”Chats” |
titleView
Custom renderer for the name / title text.| Type | Widget? Function(BuildContext, Conversation) |
| Default | Built-in title |
trailingView
Custom renderer for the timestamp / badge / right section.| Type | Widget? Function(Conversation) |
| Default | Built-in trailing view |
typingIndicatorText
Custom text shown when a user is typing.| Type | String |
| Default | ”typing…“ |
usersStatusVisibility
Controls visibility of online/offline status indicator.| Type | bool |
| Default | true |
avatarHeight
Height for user/group avatars.| Type | double |
| Default | null |
avatarWidth
Width for user/group avatars.| Type | double |
| Default | null |
avatarPadding
Padding for user/group avatars.| Type | EdgeInsetsGeometry |
| Default | null |
avatarMargin
Margin for user/group avatars.| Type | EdgeInsetsGeometry |
| Default | null |
badgeWidth
Width for unread message badge.| Type | double |
| Default | null |
badgeHeight
Height for unread message badge.| Type | double |
| Default | null |
badgePadding
Padding for unread message badge.| Type | EdgeInsetsGeometry |
| Default | null |
controllerTag
Tag for controller management. When passed, parent is responsible for closing.| Type | String |
| Default | null |
dateBackgroundIsTransparent
Controls whether the date background is transparent.| Type | bool |
| Default | null |
dateHeight
Height for the conversation date display.| Type | double |
| Default | null |
datePadding
Padding for the conversation date display.| Type | EdgeInsets |
| Default | null |
dateTimeFormatterCallback
Callback for custom date and time formatting.| Type | DateTimeFormatterCallback |
| Default | null |
dateWidth
Width for the conversation date display.| Type | double |
| Default | null |
listItemStyle
Style configuration for list items.| Type | ListItemStyle |
| Default | null |
searchContentPadding
Padding for search box content.| Type | EdgeInsetsGeometry |
| Default | null |
searchPadding
Padding for the search box.| Type | EdgeInsetsGeometry |
| Default | null |
statusIndicatorBorderRadius
Border radius for the status indicator.| Type | BorderRadiusGeometry |
| Default | null |
statusIndicatorHeight
Height for the status indicator.| Type | double |
| Default | null |
statusIndicatorWidth
Width for the status indicator.| Type | double |
| Default | null |
submitIcon
Custom submit icon for selection mode.| Type | Widget |
| Default | Built-in check icon |
Events
| Event | Payload | Fires when |
|---|---|---|
CometChatConversationEvents.ccConversationDeleted | Conversation | Conversation deleted from list |
CometChatConversationEvents.ccUpdateConversation | Conversation | Conversation updated (last message change, metadata update) |
CometChatConversationEvents.addConversationListListener() and unsubscribe with removeConversationListListener().
Customization Matrix
| What to change | Where | Property/API | Example |
|---|---|---|---|
| Override behavior on user interaction | Widget props | on<Event> callbacks | onItemTap: (c) => setActive(c) |
| Filter which conversations appear | Widget props | conversationsRequestBuilder | conversationsRequestBuilder: ConversationsRequestBuilder()..limit = 10 |
| Toggle visibility of UI elements | Widget props | <feature>Visibility boolean props | receiptsVisibility: false |
| Replace a section of the list item | Widget props | <slot>View render props | listItemView: (conversation) => CustomWidget() |
| Change colors, fonts, spacing | Widget props | conversationsStyle | conversationsStyle: CometChatConversationsStyle(backgroundColor: Colors.white) |