CometChatMessageComposer class

CometChatMessageComposer component allows users to send messages and attachments to the chat, participating in the conversation.

 CometChatMessageComposer(
       user: User(uid: 'uid', name: 'name'),
       group: Group(guid: 'guid', name: 'name', type: 'public'),
       messageComposerStyle: MessageComposerStyle(),
       stateCallBack: (CometChatMessageComposerController state) {},
       customSoundForMessage: 'asset url',
       disableSoundForMessages: true,
       hideLiveReaction: false,
       placeholderText: 'Message',
     );

Inheritance

Constructors

CometChatMessageComposer({Key? key, User? user, Group? group, MessageComposerStyle messageComposerStyle = const MessageComposerStyle(), String? placeholderText, bool hideLiveReaction = false, bool disableTypingEvents = false, bool disableSoundForMessages = false, int parentMessageId = 0, String? customSoundForMessage, String? customSoundForMessagePackage, ComposerWidgetBuilder? auxiliaryButtonView, ComposerWidgetBuilder? headerView, ComposerWidgetBuilder? footerView, ComposerWidgetBuilder? secondaryButtonView, Widget? sendButtonView, ComposerActionsBuilder? attachmentOptions, String? text, dynamic onChange(String)?, int? maxLine, AuxiliaryButtonsAlignment? auxiliaryButtonsAlignment, String? liveReactionIconURL, String? attachmentIconURL, void stateCallBack(CometChatMessageComposerController)?, CometChatTheme? theme, Widget? attachmentIcon, Widget? liveReactionIcon, OnError? onError, Widget? recordIcon, Widget? playIcon, Widget? deleteIcon, Widget? stopIcon, Widget? submitIcon, MediaRecorderStyle? mediaRecorderStyle, Widget? pauseIcon, dynamic onSendButtonTap(BuildContext, BaseMessage, PreviewMessageMode?)?, bool? hideVoiceRecording, Widget? voiceRecordingIcon, Widget? aiIcon, String? aiIconURL, String? aiIconPackageName, AIOptionsStyle? aiOptionStyle, List<CometChatTextFormatter>? textFormatters, bool? disableMentions, GlobalKey<State<StatefulWidget>>? messageComposerKey, TextEditingController? textEditingController})

Properties

aiIcon Widget?
attachmentIcon custom ai icon
final
aiIconPackageName String?
aiIconPackageName package name to show icon from
final
aiIconURL String?
aiIconURL path of the icon to show in the ai button
final
aiOptionStyle AIOptionsStyle?
set the style for ai options
final
attachmentIcon Widget?
attachmentIcon custom attachment icon
final
attachmentIconURL String?
attachmentIconURL path of the icon to show in the attachments button
final
auxiliaryButtonsAlignment AuxiliaryButtonsAlignment?
auxiliaryButtonsAlignment controls position auxiliary button view
final
auxiliaryButtonView ComposerWidgetBuilder?
auxiliaryButtonView ui component to be forwarded to message input component
final
cometChatMessageComposerController CometChatMessageComposerController
cometChatMessageComposerController contains the business logic
final
composerId Map<String, dynamic>
getter/setter pair
deleteIcon Widget?
deleteIcon provides icon to the close Icon/widget
final
disableMentions bool?
disableMentions disables mentions in the composer
final
group Group?
set group for message composer
final
hashCode int
The hash code for this object.
no setterinherited
hideVoiceRecording bool?
hideVoiceRecording provides option to hide voice recording
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
liveReactionIcon Widget?
liveReactionIcon custom live reaction icon
final
maxLine int?
maxLine maximum lines allowed to increase in the input field
final
mediaRecorderStyle MediaRecorderStyle?
mediaRecorderStyle provides style to the media recorder
final
messageComposerKey GlobalKey<State<StatefulWidget>>?
messageComposerKey key to identify the message composer
final
messageComposerStyle MessageComposerStyle
messageComposerStyle message composer style
final
onChange → dynamic Function(String)?
onChange callback to handle change in value of text in the input field
final
parentMessageId int
final
pauseIcon Widget?
pauseIcon provides icon to the play Icon/widget
final
placeholderText String?
placeholderText hint text for input field
final
playIcon Widget?
playIcon provides icon to the play Icon/widget
final
recordIcon Widget?
recordIcon provides icon to the start Icon/widget
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryButtonView ComposerWidgetBuilder?
secondaryButtonView ui component to be forwarded to message input component
final
sendButtonView Widget?
sendButtonView ui component to be forwarded to message input component
final
stopIcon Widget?
stopIcon provides icon to the stop Icon/widget
final
submitIcon Widget?
submitIcon provides icon to the submit Icon/widget
final
text String?
text initial text for the input field
final
textEditingController TextEditingController?
textEditingController controls the state of the text field
final
theme CometChatTheme?
theme sets the theme for this component
final
user User?
sets user for message composer
final
voiceRecordingIcon Widget?
voiceRecordingIcon provides icon to the voice recording Icon/widget
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited