AI Integration Quick Reference
AI Integration Quick Reference
CometChatThreadedHeader displays the parent message of a thread along with reply count and provides the container for threaded message list and composer. It enables organized threaded conversations within a chat.

Where It Fits
CometChatThreadedHeader is used when a user taps “Reply in Thread” on a message. It wraps the parent message display with a CometChatMessageList (filtered by parentMessageId) and CometChatMessageComposer for thread replies.
- Dart
Quick Start
- Dart
- Dart
BaseMessage object as the parent message.
With offline support on, a reply the user sends without a connection is counted in the reply count once, when it is queued, and taken back if the reply is removed before it was sent. See Message list and threads.
Actions and Events
Navigation (host-owned)
CometChatThreadedHeader renders the parent-message context only — it exposes no onBack or
onError callback. Provide navigation from the screen that hosts it: a pushed route already gets a
back button from its AppBar, so no wiring is required.
- Dart
The thread list and composer each need
parentMessageId and the same user/group target as
the parent chat. Passing parentMessageId alone sends replies to the wrong target.Custom message actions
UsemessageActionView to render your own actions next to the parent message.
- Dart
Thread subscription
Available since v6.1.1 WithUIKitSettings.enableThreadSubscription on, the reply-count row carries a subscribe / unsubscribe control for the thread. It flips on tap, reverts with a toast if the server rejects the change, and ignores taps while a request is in flight. onThreadSubscriptionChange fires after a toggle from this control succeeds, with the parent message ID and the new state:
- Dart
ccThreadSubscriptionChanged on CometChatMessageEvents instead.
Set threadSubscriptionVisibility: false to hide the control, for example when the header above it already carries the bell. Setting messageActionView also replaces it.
SDK Events (Real-Time, Automatic)
Functionality
Custom View Slots
Bubble View
Replace the parent message bubble display.CometChatThreadedHeader has no bubbleView parameter of
its own — pass a CometChatMessageTemplate via template and override its bubbleView.
- Dart
Advanced
BLoC Access
The threaded header usesThreadedHeaderBloc internally:
Available since v6.2.0. Pass your own instance through
threadedHeaderBloc to own that state. The header then leaves the bloc’s lifecycle to you: it does not dispatch InitializeThreadedHeader and does not close the bloc, so do both yourself — an uninitialized bloc renders an empty header.
- Dart
Style
- Dart

Next Steps
Message List
Display messages in a conversation
Message Composer
Compose and send messages
Threaded Messages Guide
Complete threaded messages implementation
Component Styling
Detailed styling reference