ChatInputField constructor

ChatInputField({
  1. Key? key,
  2. required ValueChanged<ChatMessage> onRecordComplete,
  3. required TextEditingController textController,
  4. required ValueChanged<ChatMessage> onTextSubmit,
  5. required ValueChanged<ChatMessage> onImageSelected,
  6. String cameraText = 'From Camera',
  7. String galleryText = 'From Gallery',
  8. String cancelText = 'Cancel',
  9. Icon? cameraIcon,
  10. Icon? galleryIcon,
  11. Icon? cancelIcon,
  12. TextStyle? chatBottomSheetTextStyle,
  13. double cancelThreshold = 100.0,
  14. bool showWaveAnimation = true,
  15. bool enableInput = true,
  16. TextDirection? textDirection,
  17. required String recordingNoteHintText,
  18. Duration? waveDuration,
  19. EdgeInsetsGeometry? chatFieldPadding,
  20. EdgeInsetsGeometry? chatFieldMargin,
  21. Decoration? decoration,
  22. InputDecoration? textFieldDecoration,
  23. WaveAnimationStyle? waveStyle,
  24. 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);