Skip to main content
CometChatConversations renders a scrollable list of recent conversations with real-time updates for new messages, typing indicators, read receipts, and user presence.

Where It Fits

CometChatConversations is a list component. It renders recent conversations and emits the selected Conversation via onItemTap. Wire it to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer to build a standard chat layout.

Quick Start

Using Navigator:
Embedding as a widget:
Prerequisites: CometChat SDK initialized with CometChatUIKit.init(), a user logged in, and the UI Kit dependency added.

Filtering Conversations

Pass a ConversationsRequestBuilder to control what loads:

Filter Recipes


Actions and Events

Callback Methods

onItemTap

Fires when a conversation row is tapped. Primary navigation hook.

onItemLongPress

Fires when a conversation row is long-pressed. By default shows a delete overlay (when deleteConversationOptionVisibility is true).

onBack

Fires when the user presses the back button in the app bar.

onSelection

Fires when conversations are selected/deselected in multi-select mode.

onError

Fires on internal errors (network failure, auth issue, SDK exception).

onLoad

Fires when the list is successfully fetched and loaded.

onEmpty

Fires when the list is empty after loading.

Global Events

The component emits events via CometChatConversationEvents that can be subscribed to from anywhere:

SDK Events (Real-Time, Automatic)

The component listens to these SDK events internally. No manual setup needed.

Functionality


Custom View Slots

Leading View

Replace the avatar / left section.

Title View

Replace the name / title text.

Subtitle View

Replace the last message preview.

Trailing View

Replace the timestamp / badge / right section.

List Item View

Replace the entire list item row.

State Views



Common Patterns

Minimal list — hide all chrome

Users-only conversations

Custom date formatting


Advanced

BLoC Access

Provide a custom ConversationsBloc to override behavior:

Extending ConversationsBloc

ConversationsBloc uses the ListBase<Conversation> mixin with override hooks for custom list behavior:
For ListBase override hooks (onItemAdded, onItemRemoved, onItemUpdated, onListCleared, onListReplaced), see BLoC & Data — ListBase Hooks.

Public BLoC Events

Public BLoC Methods

Route Observer

Pass a RouteObserver to freeze rebuilds when another screen is pushed on top (prevents expensive rebuilds during keyboard animation):

Style

Style Properties

See Component Styling for the full reference.

Next Steps

Users

Browse and search available users

Message List

Display messages for a conversation

Component Styling

Detailed styling reference

Message Template

Customize message bubble structure