Import
import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;API Reference
The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.
MessageComposer
const MessageComposer({
super.key,
this.controller,
this.size,
this.focusNode,
this.initialValue = '',
this.placeholder = 'Message...',
this.semanticLabel = 'Message',
this.onChanged,
this.onSend,
this.onSendError,
this.onAttachmentPressed,
this.onMicrophonePressed,
this.onVoicePressed,
this.voice,
this.onStop,
this.leadingActions = const [],
this.trailingActions = const [],
this.attachment,
this.attachments = const [],
this.onAttachmentRemoved,
this.enabled = true,
this.isSending = false,
this.autofocus = false,
this.clearOnSend = true,
this.closeOnSend = false,
this.collapsedWidthFactor = .95,
this.minExpandedLines = 2,
this.maxLines = 8,
this.fontSize,
this.lineHeight = 1.3,
this.allowEnlargement = true,
this.maxLength,
this.inputFormatters = const [],
this.errorText,
this.backgroundColor,
this.foregroundColor,
this.placeholderColor,
this.focusColor,
this.motion,
});| Parameter | Type | Required | Default |
|---|---|---|---|
key | Key? | No | null |
controller | TextEditingController? | No | null |
size | ComponentSize? | No | null |
focusNode | FocusNode? | No | null |
initialValue | String | No | '' |
placeholder | String | No | 'Message...' |
semanticLabel | String | No | 'Message' |
onChanged | ValueChanged<String>? | No | null |
onSend | FutureOr<void> Function(String text)? | No | null |
onSendError | void Function(Object error, StackTrace stackTrace)? | No | null |
onAttachmentPressed | VoidCallback? | No | null |
onMicrophonePressed | VoidCallback? | No | null |
onVoicePressed | VoidCallback? | No | null |
voice | MessageComposerVoice? | No | null |
onStop | VoidCallback? | No | null |
leadingActions | List<Widget> | No | const [] |
trailingActions | List<Widget> | No | const [] |
attachment | Widget? | No | null |
attachments | List<MessageComposerAttachment> | No | const [] |
onAttachmentRemoved | ValueChanged<MessageComposerAttachment>? | No | null |
enabled | bool | No | true |
isSending | bool | No | false |
autofocus | bool | No | false |
clearOnSend | bool | No | true |
closeOnSend | bool | No | false |
collapsedWidthFactor | double | No | .95 |
minExpandedLines | int | No | 2 |
maxLines | int | No | 8 |
fontSize | double? | No | null |
lineHeight | double | No | 1.3 |
allowEnlargement | bool | No | true |
maxLength | int? | No | null |
inputFormatters | List<TextInputFormatter> | No | const [] |
errorText | String? | No | null |
backgroundColor | Color? | No | null |
foregroundColor | Color? | No | null |
placeholderColor | Color? | No | null |
focusColor | Color? | No | null |
motion | ComponentMotion? | No | null |
Application Setup
Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.
Source
lib/src/widgets/messaging/message_composer/message_composer.dart
This reference is generated from the MessageComposer declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

