ChatInputField constructor
ChatInputField({
- 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.
Implementation
ChatInputField({
Key? key,
required this.onRecordComplete,
required this.textController,
required this.onTextSubmit,
required this.onImageSelected,
this.cameraText = 'From Camera',
this.galleryText = 'From Gallery',
this.cancelText = 'Cancel',
this.cameraIcon,
this.galleryIcon,
this.cancelIcon,
this.chatBottomSheetTextStyle,
this.cancelThreshold = 100.0,
this.showWaveAnimation = true,
this.enableInput = true,
this.textDirection,
required this.recordingNoteHintText,
Duration? waveDuration,
EdgeInsetsGeometry? chatFieldPadding,
EdgeInsetsGeometry? chatFieldMargin,
Decoration? decoration,
InputDecoration? textFieldDecoration,
WaveAnimationStyle? waveStyle,
RecordingButtonStyle? buttonStyle,
}) : waveDuration = waveDuration ?? const Duration(milliseconds: 600),
chatFieldPadding =
chatFieldPadding ?? const EdgeInsets.symmetric(vertical: 6),
chatFieldMargin =
chatFieldMargin ?? const EdgeInsets.symmetric(horizontal: 6),
decoration = decoration ??
BoxDecoration(
color: Colors.black12, borderRadius: BorderRadius.circular(26)),
textFieldDecoration = textFieldDecoration ??
const InputDecoration.collapsed(
hintText: 'Type a message',
),
waveStyle = waveStyle ?? const WaveAnimationStyle(),
buttonStyle = buttonStyle ?? const RecordingButtonStyle(),
super(key: key);