CometChatMessageList and CometChatThreadedHeader components.
Overview
- Reply to specific messages to start focused sub-conversations
- View all replies grouped under the parent message
- Seamlessly switch back to the main conversation
Prerequisites
- A Flutter project with CometChat UIKit Flutter V6 installed
- Initialized CometChat credentials
Components
| Component | Role |
|---|---|
CometChatMessageList | Displays main chat; provides onThreadRepliesClick callback |
CometChatThreadedHeader | Shows the parent message and thread context |
CometChatMessageComposer | Sends new messages; pass parentMessageId for replies |
Integration Steps
Show the “Reply in Thread” Option
- Dart
Navigate to the Thread Screen
In V6, compose the thread screen using individual widgets:- Dart
Send a Threaded Message
- Dart
Customization Options
- Header Styling: Customize
CometChatThreadedHeaderappearance - Composer Placeholder: Change placeholder text based on thread context
- Empty State: Display “No replies yet” when thread is empty
Summary
| Feature | Component / Method |
|---|---|
| Show thread option | CometChatMessageList.onThreadRepliesClick |
| Thread view screen | Custom ThreadScreen widget |
| Display threaded messages | CometChatMessageList(parentMessageId: ...) |
| Send threaded message | CometChatMessageComposer(parentMessageId: ...) |
| Thread header | CometChatThreadedHeader(message: ...) |