Composer class

The message composer widget positioned at the bottom of the chat screen.

Includes a text input field, an optional attachment button, and a send button.

Inheritance

Constructors

Composer.new({Key? key, TextEditingController? textEditingController, double? left = 0, double? right = 0, double? top, double? bottom = 0, double? sigmaX = 20, double? sigmaY = 20, EdgeInsetsGeometry? padding = const EdgeInsets.only(left: 16, right: 16, top: 11, bottom: 11), Widget? attachmentIcon = const Icon(Icons.attachment), Widget? sendIcon = const Icon(Icons.send), double? gap = 8, InputBorder? inputBorder = const OutlineInputBorder(borderSide: BorderSide.none, borderRadius: BorderRadius.all(Radius.circular(24))), bool? filled = true, Widget? topWidget, bool? handleSafeArea = true, Color? backgroundColor, Color? attachmentIconColor, Color? sendIconColor, Color? emptyFieldSendIconColor, Color? hintColor, Color? textColor, Color? inputFillColor, String? hintText = 'Type a message', Brightness? keyboardAppearance, bool? autocorrect, bool autofocus = false, TextCapitalization textCapitalization = TextCapitalization.sentences, TextInputType? keyboardType, TextInputAction? textInputAction = TextInputAction.newline, FocusNode? focusNode, int? maxLength, int? minLines = 1, int? maxLines = 3, required ShapeBorder? shapeBorder})
Creates a message composer widget.
const

Properties

attachmentIcon Widget?
Icon for the attachment button. Defaults to Icons.attachment.
final
attachmentIconColor Color?
Color of the attachment icon.
final
autocorrect bool?
Whether to enable autocorrect for the input field.
final
autofocus bool
Whether the input field should autofocus.
final
backgroundColor Color?
Background color of the composer container.
final
bottom double?
Optional bottom position.
final
emptyFieldSendIconColor Color?
Color of the send icon when the text is empty.
final
filled bool?
Whether the text input field should be filled.
final
focusNode FocusNode?
Focus node for the text input field.
final
gap double?
Horizontal gap between elements (attachment icon, text field, send icon).
final
handleSafeArea bool?
Whether to adjust padding for the bottom safe area.
final
hashCode int
The hash code for this object.
no setterinherited
hintColor Color?
Color of the hint text in the input field.
final
hintText String?
Placeholder text for the input field.
final
inputBorder InputBorder?
Border style for the text input field.
final
inputFillColor Color?
Fill color for the text input field when filled is true.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardAppearance Brightness?
Appearance of the keyboard.
final
keyboardType TextInputType?
Type of keyboard to display.
final
left double?
Optional left position.
final
maxLength int?
Maximum character length for the input field.
final
maxLines int?
Maximum number of lines the input field can expand to.
final
minLines int?
Minimum number of lines for the input field.
final
padding EdgeInsetsGeometry?
Padding around the composer content.
final
Optional right position.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendIcon Widget?
Icon for the send button. Defaults to Icons.send.
final
sendIconColor Color?
Color of the send icon.
final
shapeBorder ShapeBorder?
final
sigmaX double?
Optional X blur value for the background (if using glassmorphism).
final
sigmaY double?
Optional Y blur value for the background (if using glassmorphism).
final
textCapitalization TextCapitalization
Capitalization behavior for the input field.
final
textColor Color?
Color of the text entered in the input field.
final
textEditingController TextEditingController?
Optional controller for the text input field.
final
textInputAction TextInputAction?
Action button type for the keyboard (e.g., newline, send).
final
top double?
Optional top position.
final
topWidget Widget?
Optional widget to display above the main composer row.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<Composer>
Creates the mutable state for this widget at a given location in the tree.
override
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, int wrapWidth = 65}) 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