Skip to main content
CometChatMessageList renders a scrollable list of messages for a conversation with real-time updates for new messages, edits, deletions, reactions, and threaded replies.

Where It Fits

CometChatMessageList is a message display component. It requires either a User or Group object to fetch and render messages. Wire it with CometChatMessageHeader and CometChatMessageComposer to build a complete messaging 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.
Simply adding the MessageList component to the layout will only display the loading indicator. You must supply a User or Group object to fetch messages.

Filtering

Pass a MessagesRequestBuilder to control what loads:
The following parameters in MessagesRequestBuilder will always be altered inside the message list: UID, GUID, types, categories.

Actions and Events

Callback Methods

onThreadRepliesClick

Fires when a user taps a threaded message bubble.

onError

Fires on internal errors.

onLoad

Fires when the list is successfully fetched and loaded.

onEmpty

Fires when the list is empty after loading.

onReactionClick

Fires when a reaction pill is tapped.

onReactionLongPress

Fires when a reaction pill is long-pressed.

SDK Events (Real-Time, Automatic)

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

Functionality

* One of user or group is required.

Custom View Slots

Header View

Custom view displayed at the top of the message list.
Custom view displayed at the bottom of the message list.

State Views

Text Formatters (Mentions)

Message Templates

Override or extend message bubble rendering:
See Message Template for the full template structure.

Message Option Visibility


Common Patterns

Thread replies view

Jump to a specific message

Start from unread messages

Load last agent conversation

Resume the most recent AI agent conversation on start:

Flag / Report a message

Flag/report is available by default from the message long-press menu. Toggle its visibility and customize the dialog:

Mark a message as unread

Expose the “Mark as Unread” option in the long-press menu:

Advanced

BLoC Access

Provide a custom MessageListBloc to override behavior:

Extending MessageListBloc

MessageListBloc uses the ListBase<BaseMessage> mixin with override hooks:
For ListBase override hooks (onItemAdded, onItemRemoved, onItemUpdated, onListCleared, onListReplaced), see BLoC & Data — ListBase Hooks.

Public BLoC Events

Public BLoC Methods

O(1) Lookup Methods

ValueNotifier Accessors (Isolated Rebuilds)

MessageReceiptStatus Enum

Operations Stream

The BLoC exposes an operationsStream consumed by CometChatAnimatedMessageList for smooth animations:

Style

See Component Styling and Message Bubble Styling for the full reference.

Next Steps

Message Header

Display user/group info in the app bar

Message Composer

Rich input for sending messages

Message Template

Customize message bubble structure

Component Styling

Detailed styling reference