ChatInputField class
A chat input field with text entry and press‑and‑hold + slide‑to‑cancel recording. All visuals and durations can be customized via constructor parameters.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ChatInputField
Constructors
-
ChatInputField.new({Key? key, required ValueChanged<
ChatMessage> onRecordComplete, required TextEditingController textController, required ValueChanged<ChatMessage> onTextSubmit, required ValueChanged<ChatMessage> onImageSelected, String cameraText = 'From Camera', String galleryText = 'From Gallery', String cancelText = 'Cancel', Icon? cameraIcon, Icon? galleryIcon, Icon? cancelIcon, TextStyle? chatBottomSheetTextStyle, double cancelThreshold = 100.0, bool showWaveAnimation = true, bool enableInput = true, TextDirection? textDirection, required String recordingNoteHintText, Duration? waveDuration, EdgeInsetsGeometry? chatFieldPadding, EdgeInsetsGeometry? chatFieldMargin, Decoration? decoration, InputDecoration? textFieldDecoration, WaveAnimationStyle? waveStyle, RecordingButtonStyle? buttonStyle}) - Creates a chat input field.
Properties
-
Customization for the recording/send button.
final
- cameraIcon → Icon?
-
Icon for the “From Camera” option.
used for ChatBottomSheet
final
- cameraText → String
-
Label for the “From Camera” option.
used for ChatBottomSheet
final
- cancelIcon → Icon?
-
Icon for the “Cancel” option.
used for ChatBottomSheet
final
- cancelText → String
-
Label for the “Cancel” option.
used for ChatBottomSheet
final
- cancelThreshold → double
-
Horizontal drag distance (in px) to cancel recording.
final
- chatBottomSheetTextStyle → TextStyle?
-
Text style applied to all option labels.
used for ChatBottomSheet
final
- chatFieldMargin → EdgeInsetsGeometry
-
Margin around the main container.
final
- chatFieldPadding → EdgeInsetsGeometry
-
Padding inside the main container.
final
- decoration → Decoration
-
Decoration for the main container.
final
- enableInput → bool
-
final
- galleryIcon → Icon?
-
Icon for the “From Gallery” option.
used for ChatBottomSheet
final
- galleryText → String
-
Label for the “From Gallery” option.
used for ChatBottomSheet
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onImageSelected
→ ValueChanged<
ChatMessage> -
Invoked with a ChatMessage when an image is picked, or
null
on cancel.final -
onRecordComplete
→ ValueChanged<
ChatMessage> -
Called when non‑empty text is submitted.
Called when an audio recording successfully completes.
final
-
onTextSubmit
→ ValueChanged<
ChatMessage> -
final
- recordingNoteHintText → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showWaveAnimation → bool
-
Whether to show the wave animation during recording.
final
- textController → TextEditingController
-
Controller for the text input.
final
- textDirection → TextDirection?
-
final
- textFieldDecoration → InputDecoration
-
Decoration for the TextField input.
final
- waveDuration → Duration
-
Duration of the wave animation cycle.
final
- waveStyle → WaveAnimationStyle
-
Customization for the wave animation widget.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _ChatInputFieldState -
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