LedgerComposer class

The message input that docks at the foot of a conversation: a ringed round of the raised paper holding the field, onAttachPressed before it, and at its end the green send once there are words to send, onVoicePressed while there are none, and the ink stop while sending runs (onStopPressed ends it). Enter sends from a hardware keyboard on a single line field; the field grows with its words. Stand it as a LedgerScreen(footer:) or in a sheet's foot, where the band owns the room round it. LedgerComposerStyle.assistant is the larger slip for an ask to an assistant, with a toolbar under the words. Says its semanticLabel (the hint by default), and each act its own name.

LedgerComposer(controller: reply, hint: 'Write a reply', onAttachPressed: pick, onSubmitted: () => send(reply.text))
Inheritance

Constructors

LedgerComposer({TextEditingController? controller, String hint = 'Write a message', LedgerComposerStyle style = LedgerComposerStyle.messages, VoidCallback? onSubmitted, VoidCallback? onStopPressed, VoidCallback? onAttachPressed, VoidCallback? onVoicePressed, bool sending = false, List<Widget> toolbar = const [], String sendLabel = 'Send', String? semanticLabel, FocusNode? focusNode, bool autofocus = false, Key? key})
A message input that sends its words with onSubmitted.
const

Properties

autofocus → bool
Whether it takes focus when it first appears.
final
controller → TextEditingController?
The words typed; null gives the composer one of its own.
final
focusNode → FocusNode?
The control's focus; null keeps one of its own. The caller disposes the node it gives.
final
hashCode → int
The hash code for this object.
no setterinherited
hint → String
What stands in the field while it is empty.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onAttachPressed → VoidCallback?
Opens the attachment picker; the glyph is left out without it.
final
onStopPressed → VoidCallback?
Ends the send in flight (shown while sending).
final
onSubmitted → VoidCallback?
Sends the words; null leaves the send inert.
final
onVoicePressed → VoidCallback?
Starts a spoken message; shown while the field is empty.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String?
Its name for a screen reader; null speaks the hint.
final
sending → bool
Whether a send is in flight: the stop shows in the send's place.
final
sendLabel → String
What a screen reader says the send is.
final
style → LedgerComposerStyle
How the composer sits.
final
toolbar → List<Widget>
The assistant slip's chips under the words.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<LedgerComposer>
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.
override
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