AI Agent Component Spec
AI Agent Component Spec
Where It Fits
CometChatSearch is a full-screen search experience that allows users to find messages, conversations, media, and more through an intuitive and filterable search interface. It can be embedded in multiple contexts — as part of the conversation list, message header, or as a standalone full-screen search experience.
Minimal Render
The simplest way to render CometChatSearch:- Dart
- Dart
Filtering
Use the request builder props to filter which items appear in the search results.ConversationsRequestBuilder
Filter conversations in the search results:- Dart
MessagesRequestBuilder
Filter messages in the search results:- Dart
Scoped Search
Search within a specific user or group conversation:- Dart
Actions and Events
Callback Props
Component-level callbacks that fire on specific user interactions:| Callback | Signature | Fires When |
|---|---|---|
onConversationClicked | void Function(Conversation conversation)? | User clicks a conversation from search results |
onMessageClicked | void Function(BaseMessage message)? | User clicks a message from search results |
onBack | VoidCallback? | User clicks the back button |
onError | OnError? | An error occurs in the component |
onConversationsLoad | OnLoad<Conversation>? | Conversations are loaded |
onMessagesLoad | OnLoad<BaseMessage>? | Messages are loaded |
onEmpty | OnEmpty? | Search results are empty |
- Dart
Global UI Events
The CometChatSearch component does not produce any global UI events.Custom View Slots
Customize the appearance of CometChatSearch by replacing default views with your own widgets.State Views
| Slot | Signature | Replaces |
|---|---|---|
loadingStateView | WidgetBuilder? | Loading spinner |
emptyStateView | WidgetBuilder? | Empty state display |
errorStateView | WidgetBuilder? | Error state display |
initialStateView | WidgetBuilder? | Initial state before search |
Conversation View Slots
| Slot | Signature | Replaces |
|---|---|---|
conversationItemView | Widget? Function(BuildContext, Conversation)? | Entire conversation list item |
conversationLeadingView | Widget? Function(BuildContext, Conversation)? | Avatar / left section |
conversationTitleView | Widget? Function(BuildContext, Conversation)? | Name / title text |
conversationSubtitleView | Widget? Function(BuildContext, Conversation)? | Secondary text / preview |
conversationTailView | Widget? Function(BuildContext, Conversation)? | Right section / timestamp |
Message View Slots
| Slot | Signature | Replaces |
|---|---|---|
searchTextMessageView | Widget? Function(BuildContext, TextMessage)? | Text message item |
searchImageMessageView | Widget? Function(BuildContext, MediaMessage)? | Image message item |
searchVideoMessageView | Widget? Function(BuildContext, MediaMessage)? | Video message item |
searchFileMessageView | Widget? Function(BuildContext, MediaMessage)? | File message item |
searchAudioMessageView | Widget? Function(BuildContext, MediaMessage)? | Audio message item |
searchMessageLinkView | Widget? Function(BuildContext, BaseMessage)? | Link message item |
Example: Custom Text Message View
- Dart

Icon Customization
| Prop | Type | Description |
|---|---|---|
searchBackIcon | Widget? | Custom back icon |
searchClearIcon | Widget? | Custom clear icon |
Styling
Customize the appearance of CometChatSearch usingCometChatSearchStyle.

- Dart
Style Properties
| Property | Type | Description |
|---|---|---|
backgroundColor | Color? | Background color of the search component |
searchBackgroundColor | Color? | Background color of the search text field |
searchBorder | BorderSide? | Border of the search text field |
searchBorderRadius | BorderRadius? | Border radius of the search text field |
searchTextColor | Color? | Color of the search text |
searchTextStyle | TextStyle? | Style of the search text |
searchPlaceHolderTextColor | Color? | Color of the placeholder text |
searchPlaceHolderTextStyle | TextStyle? | Style of the placeholder text |
searchBackIconColor | Color? | Color of the back icon |
searchClearIconColor | Color? | Color of the clear icon |
searchFilterChipBackgroundColor | Color? | Background color of filter chips |
searchFilterChipSelectedBackgroundColor | Color? | Background color of selected filter chips |
searchFilterChipTextColor | Color? | Text color of filter chips |
searchFilterChipTextStyle | TextStyle? | Text style of filter chips |
searchFilterChipSelectedTextColor | Color? | Text color of selected filter chips |
searchFilterChipSelectedTextStyle | TextStyle? | Text style of selected filter chips |
searchFilterIconColor | Color? | Color of filter icons |
searchFilterSelectedIconColor | Color? | Color of selected filter icons |
searchFilterChipBorder | Border? | Border of filter chips |
searchFilterChipSelectedBorder | Border? | Border of selected filter chips |
searchFilterChipBorderRadius | BorderRadius? | Border radius of filter chips |
searchSectionHeaderTextColor | Color? | Color of section header text |
searchSectionHeaderTextStyle | TextStyle? | Style of section header text |
searchConversationItemBackgroundColor | Color? | Background color of conversation items |
searchConversationTitleTextColor | Color? | Text color of conversation titles |
searchConversationTitleTextStyle | TextStyle? | Style of conversation titles |
searchConversationSubTitleTextStyle | TextStyle? | Style of conversation subtitles |
searchConversationTitleSubTextColor | Color? | Text color of conversation subtitles |
searchConversationDateTextColor | Color? | Text color of conversation dates |
searchConversationDateTextStyle | TextStyle? | Style of conversation dates |
searchMessageItemBackgroundColor | Color? | Background color of message items |
searchMessageTitleTextColor | Color? | Text color of message titles |
searchMessageTitleTextStyle | TextStyle? | Style of message titles |
searchMessageSubTitleTextColor | Color? | Text color of message subtitles |
searchMessageSubTitleTextStyle | TextStyle? | Style of message subtitles |
searchMessageTimeStampStyle | CometChatDateStyle? | Style of message timestamps |
searchMessageDateSeparatorStyle | CometChatDateStyle? | Style of date separators |
searchEmptyStateTextColor | Color? | Text color for empty state |
searchEmptyStateTextStyle | TextStyle? | Style for empty state text |
searchEmptyStateSubtitleColor | Color? | Color for empty state subtitle |
searchEmptyStateSubtitleStyle | TextStyle? | Style for empty state subtitle |
searchErrorStateTextColor | Color? | Text color for error state |
searchErrorStateTextStyle | TextStyle? | Style for error state text |
searchErrorStateSubtitleColor | Color? | Color for error state subtitle |
searchErrorStateSubtitleStyle | TextStyle? | Style for error state subtitle |
searchSeeMoreColor | Color? | Color of “See More” button |
searchSeeMoreStyle | TextStyle? | Style of “See More” button |
avatarStyle | CometChatAvatarStyle? | Style for avatars |
badgeStyle | CometChatBadgeStyle? | Style for badges |
Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
user | User? | null | User object for scoped search |
group | Group? | null | Group object for scoped search |
searchFilters | List<SearchFilter>? | null | List of filters to show |
searchIn | List<SearchScope>? | null | List of search scopes |
usersStatusVisibility | bool? | null | Show/hide user status indicator |
receiptsVisibility | bool? | null | Show/hide message receipts |
groupTypeVisibility | bool? | null | Show/hide group type icon |
onBack | VoidCallback? | null | Back button callback |
onConversationClicked | Function(Conversation)? | null | Conversation click callback |
onMessageClicked | Function(BaseMessage)? | null | Message click callback |
onError | OnError? | null | Error callback |
onConversationsLoad | OnLoad<Conversation>? | null | Conversations load callback |
onMessagesLoad | OnLoad<BaseMessage>? | null | Messages load callback |
onEmpty | OnEmpty? | null | Empty state callback |
loadingStateView | WidgetBuilder? | null | Custom loading view |
errorStateView | WidgetBuilder? | null | Custom error view |
emptyStateView | WidgetBuilder? | null | Custom empty view |
initialStateView | WidgetBuilder? | null | Custom initial view |
conversationItemView | Widget? Function(BuildContext, Conversation)? | null | Custom conversation item |
conversationTitleView | Widget? Function(BuildContext, Conversation)? | null | Custom conversation title |
conversationLeadingView | Widget? Function(BuildContext, Conversation)? | null | Custom conversation leading view |
conversationSubtitleView | Widget? Function(BuildContext, Conversation)? | null | Custom conversation subtitle |
conversationTailView | Widget? Function(BuildContext, Conversation)? | null | Custom conversation tail view |
searchTextMessageView | Widget? Function(BuildContext, TextMessage)? | null | Custom text message view |
searchImageMessageView | Widget? Function(BuildContext, MediaMessage)? | null | Custom image message view |
searchVideoMessageView | Widget? Function(BuildContext, MediaMessage)? | null | Custom video message view |
searchFileMessageView | Widget? Function(BuildContext, MediaMessage)? | null | Custom file message view |
searchAudioMessageView | Widget? Function(BuildContext, MediaMessage)? | null | Custom audio message view |
searchMessageLinkView | Widget? Function(BuildContext, BaseMessage)? | null | Custom link message view |
searchBackIcon | Widget? | null | Custom back icon |
searchClearIcon | Widget? | null | Custom clear icon |
dateSeparatorFormatterCallback | DateTimeFormatterCallback? | null | Date separator formatter |
timeSeparatorFormatterCallback | DateTimeFormatterCallback? | null | Time separator formatter |
conversationsProtocol | ConversationsBuilderProtocol? | null | Conversations builder protocol |
conversationsRequestBuilder | ConversationsRequestBuilder? | null | Conversations request builder |
messagesRequestBuilder | MessagesRequestBuilder? | null | Messages request builder |
searchStyle | CometChatSearchStyle? | null | Style configuration |