Overview
CometChatMessageComposer is a Widget that enables users to write and send a variety of messages, including text, image, video, and custom messages.
Features such as Live Reaction, Attachments, Message Editing, Rich Text Formatting, Code Blocks, and Inline Audio Recording are supported.
CometChatMessageComposer is comprised of the following Base Widgets:
In V6, the composer is powered by
MessageComposerBloc and decomposed into focused sub-widgets.
Usage
Integration
1. Using Navigator to Launch CometChatMessageComposer
- Dart
2. Embedding CometChatMessageComposer as a Widget in the build Method
- Dart
Actions
1. OnSendButtonClick
TheOnSendButtonClick event gets activated when the send message button is clicked.
- Dart
2. onChange
Handles changes in the value of text in the input field.- Dart
3. onError
Listens for any errors that occur.- Dart
Filters
CometChatMessageComposer widget does not have any available filters.
Events
TheCometChatMessageComposer Widget does not emit any events of its own.
Customization
Style
1. CometChatMessageComposerStyle
- Dart
2. MediaRecorder Style
- Dart
Functionality
- Dart
Message Composer Properties
Advanced
TextFormatters
- Dart
AttachmentOptions
- Dart
AuxiliaryButton Widget
You can customize the auxiliary button area (mic, sticker, etc.) using theauxiliaryButtonView parameter:
- Dart
Layout
The composer skeleton supports two layouts via thelayout prop:
All existing props (hide flags, view slots, style, mentions, rich text, voice recording, reply/edit preview, AI options) work identically in both layouts.
- Dart
Rich Text Formatting
The composer ships with a WYSIWYG rich-text toolbar that parses Markdown as the user types and renders formatted spans in place. Configuration is done with three flat props.Enable with defaults
Rich text is on by default — no props required.- Dart
Show or hide the toolbar UI
showRichTextFormattingOptions controls toolbar visibility. When false, markdown is still parsed in typed text but no toolbar is rendered.
- Dart
Hide specific format buttons
Pass aSet<FormatType> listing the buttons to remove from the toolbar.
- Dart
Disable rich text entirely
SetenableRichTextFormatting: false to behave as a plain text field — no markdown parsing, no toolbar, regardless of the other two props.
- Dart
FormatType values
Custom toolbar view
richTextToolbarView receives the active controller. Because the controller is a RichTextEditingController under the hood, apply formats directly via applyFormat.
- Dart