ChatInputField class
The chat input field: a text field with a slide-to-cancel voice recorder and an attachment (camera / gallery) entry point.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ChatInputField
Constructors
- ChatInputField({Key? key, double buttonRadius = 35, double containerBorderRadius = 40, required String sendMessageHintText, required String recordingNoteHintText, TextDirection textDirection = TextDirection.ltr, BoxDecoration? chatInputFieldDecoration, Widget sliderButtonContent = const Icon(Icons.chevron_right, color: Colors.white, size: 25), IconData sendTextIcon = Icons.send, ResolutionPreset cameraResolution = ResolutionPreset.high, int audioBitRate = 128000, int imageQuality = 70, double imageMaxWidth = 1440, required VoidCallback onSlideToCancelRecord, required dynamic handleRecord(ChatMessage? audioMessage, bool canceled), required dynamic onTextSubmit(ChatMessage text), required dynamic handleImageSelect(ChatMessage? imageMessage), dynamic handleVideoSelect(ChatMessage? videoMessage)?, required Color chatInputFieldColor, required String imageAttachmentFromGalleryText, required String imageAttachmentFromCameraText, required String imageAttachmentCancelText, required bool disableInput, EdgeInsets? chatInputFieldPadding, Icon? imageAttachmentFromGalleryIcon, Icon? imageAttachmentFromCameraIcon, Icon? imageAttachmentCancelIcon, TextStyle? imageAttachmentTextStyle, TextEditingController? textEditingController, dynamic attachmentClick(BuildContext context)?})
-
const
Properties
- attachmentClick → dynamic Function(BuildContext context)?
-
optional override for the default attachment bottom sheet
final
- audioBitRate → int
-
bit rate used when recording voice notes
final
-
Radius of the send/record button. Defaults to 35.
final
- cameraResolution → ResolutionPreset
-
resolution used by the in-app camera
final
- chatInputFieldColor → Color
-
background color of the input field container
final
- chatInputFieldDecoration → BoxDecoration?
-
custom decoration for the input field container
final
- chatInputFieldPadding → EdgeInsets?
-
final
- containerBorderRadius → double
-
Radius of the input field container. Defaults to 40.
final
- disableInput → bool
-
disables the whole input when
truefinal - handleImageSelect → dynamic Function(ChatMessage? imageMessage)
-
callback for a selected/captured image
final
- handleRecord → dynamic Function(ChatMessage? audioMessage, bool canceled)
-
callback for a recorded voice note
final
- handleVideoSelect → dynamic Function(ChatMessage? videoMessage)?
-
callback for a captured video
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageAttachmentCancelIcon → Icon?
-
icon shown for the "cancel" attachment option
final
- imageAttachmentCancelText → String
-
text shown for the "cancel" attachment option
final
- imageAttachmentFromCameraIcon → Icon?
-
icon shown for the "from camera" attachment option
final
- imageAttachmentFromCameraText → String
-
text shown for the "from camera" attachment option
final
- imageAttachmentFromGalleryIcon → Icon?
-
icon shown for the "from gallery" attachment option
final
- imageAttachmentFromGalleryText → String
-
text shown for the "from gallery" attachment option
final
- imageAttachmentTextStyle → TextStyle?
-
text style for the attachment bottom sheet entries
final
- imageMaxWidth → double
-
max width (px) applied to gallery images
final
- imageQuality → int
-
quality (0-100) applied to gallery images
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onSlideToCancelRecord → VoidCallback
-
callback when the slider is completed (recording canceled)
final
- onTextSubmit → dynamic Function(ChatMessage text)
-
callback when a text message is sent
final
- recordingNoteHintText → String
-
hint text shown while recording a voice note
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendMessageHintText → String
-
hint text shown for sending messages
final
- sendTextIcon → IconData
-
The icon used to send a text message
final
- sliderButtonContent → Widget
-
The widget shown on the moving slider element while recording.
final
- textDirection → TextDirection
-
text direction of the input field
final
- textEditingController → TextEditingController?
-
optional external controller for the input text
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ChatInputField> -
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