DashChat constructor

DashChat({
  1. Key? key,
  2. ScrollToBottomStyle? scrollToBottomStyle,
  3. double avatarMaxSize = 30.0,
  4. TextDirection inputTextDirection = TextDirection.ltr,
  5. EdgeInsets inputToolbarMargin = const EdgeInsets.all(0.0),
  6. EdgeInsets inputToolbarPadding = const EdgeInsets.all(0.0),
  7. bool shouldShowLoadEarlier = false,
  8. Widget showLoadEarlierWidget()?,
  9. Function? onLoadEarlier,
  10. bool sendOnEnter = false,
  11. TextInputAction? textInputAction,
  12. bool scrollToBottom = true,
  13. Widget scrollToBottomWidget()?,
  14. Function? onScrollToBottomPress,
  15. dynamic onQuickReply(
    1. Reply
    )?,
  16. EdgeInsetsGeometry quickReplyPadding = const EdgeInsets.all(0.0),
  17. BoxDecoration? quickReplyStyle,
  18. TextStyle? quickReplyTextStyle,
  19. Widget quickReplyBuilder(
    1. Reply
    )?,
  20. bool quickReplyScroll = false,
  21. EdgeInsetsGeometry messageContainerPadding = const EdgeInsets.only(left: 2.0, right: 2.0),
  22. ScrollController? scrollController,
  23. Color? inputCursorColor,
  24. double inputCursorWidth = 2.0,
  25. bool showInputCursor = true,
  26. int inputMaxLines = 1,
  27. BoxDecoration? inputContainerStyle,
  28. TextStyle? inputTextStyle,
  29. List<Widget> leading = const <Widget>[],
  30. List<Widget> trailing = const <Widget>[],
  31. BoxDecoration? messageContainerDecoration,
  32. int messageContainerFlex = 1,
  33. double? height,
  34. double? width,
  35. bool readOnly = false,
  36. required List<ChatMessage> messages,
  37. dynamic onTextChange(
    1. String
    )?,
  38. String? text,
  39. bool inputDisabled = false,
  40. TextEditingController? textController,
  41. FocusNode? focusNode,
  42. InputDecoration? inputDecoration,
  43. TextCapitalization textCapitalization = TextCapitalization.none,
  44. bool alwaysShowSend = false,
  45. String messageIdGenerator()?,
  46. DateFormat? dateFormat,
  47. DateFormat? timeFormat,
  48. required ChatUser user,
  49. required dynamic onSend(
    1. ChatMessage
    ),
  50. dynamic onLongPressAvatar(
    1. ChatUser
    )?,
  51. dynamic onLongPressMessage(
    1. ChatMessage
    )?,
  52. dynamic onPressAvatar(
    1. ChatUser
    )?,
  53. Widget avatarBuilder(
    1. ChatUser
    )?,
  54. bool showAvatarForEveryMessage = false,
  55. bool showUserAvatar = false,
  56. bool inverted = false,
  57. int? maxInputLength,
  58. List<MatchText> parsePatterns = const <MatchText>[],
  59. Widget chatFooterBuilder()?,
  60. Widget messageBuilder(
    1. ChatMessage
    )?,
  61. Widget inputFooterBuilder()?,
  62. Widget sendButtonBuilder(
    1. Function
    )?,
  63. Widget dateBuilder(
    1. String
    )?,
  64. Widget messageImageBuilder(
    1. String? url, [
    2. ChatMessage
    ])?,
  65. Widget messageTextBuilder(
    1. String?, [
    2. ChatMessage
    ])?,
  66. Widget messageTimeBuilder(
    1. String formattedTime, [
    2. ChatMessage
    ])?,
  67. bool showTraillingBeforeSend = true,
  68. bool shouldStartMessagesFromTop = false,
  69. List<Widget> messageButtonsBuilder(
    1. ChatMessage
    )?,
  70. EdgeInsets messagePadding = const EdgeInsets.all(8.0),
  71. bool textBeforeImage = true,
  72. BoxDecoration messageDecorationBuilder(
    1. ChatMessage,
    2. bool?
    )?,
})

Implementation

DashChat({
  Key? key,
  ScrollToBottomStyle? scrollToBottomStyle,
  this.avatarMaxSize = 30.0,
  this.inputTextDirection = TextDirection.ltr,
  this.inputToolbarMargin = const EdgeInsets.all(0.0),
  this.inputToolbarPadding = const EdgeInsets.all(0.0),
  this.shouldShowLoadEarlier = false,
  this.showLoadEarlierWidget,
  this.onLoadEarlier,
  this.sendOnEnter = false,
  this.textInputAction,
  this.scrollToBottom = true,
  this.scrollToBottomWidget,
  this.onScrollToBottomPress,
  this.onQuickReply,
  this.quickReplyPadding = const EdgeInsets.all(0.0),
  this.quickReplyStyle,
  this.quickReplyTextStyle,
  this.quickReplyBuilder,
  this.quickReplyScroll = false,
  this.messageContainerPadding = const EdgeInsets.only(
    left: 2.0,
    right: 2.0,
  ),
  this.scrollController,
  this.inputCursorColor,
  this.inputCursorWidth = 2.0,
  this.showInputCursor = true,
  this.inputMaxLines = 1,
  this.inputContainerStyle,
  this.inputTextStyle,
  this.leading = const <Widget>[],
  this.trailing = const <Widget>[],
  this.messageContainerDecoration,
  this.messageContainerFlex = 1,
  this.height,
  this.width,
  this.readOnly = false,
  required this.messages,
  this.onTextChange,
  this.text,
  this.inputDisabled = false,
  this.textController,
  this.focusNode,
  this.inputDecoration,
  this.textCapitalization = TextCapitalization.none,
  this.alwaysShowSend = false,
  this.messageIdGenerator,
  this.dateFormat,
  this.timeFormat,
  required this.user,
  required this.onSend,
  this.onLongPressAvatar,
  this.onLongPressMessage,
  this.onPressAvatar,
  this.avatarBuilder,
  this.showAvatarForEveryMessage = false,
  this.showUserAvatar = false,
  this.inverted = false,
  this.maxInputLength,
  this.parsePatterns = const <MatchText>[],
  this.chatFooterBuilder,
  this.messageBuilder,
  this.inputFooterBuilder,
  this.sendButtonBuilder,
  this.dateBuilder,
  this.messageImageBuilder,
  this.messageTextBuilder,
  this.messageTimeBuilder,
  this.showTraillingBeforeSend = true,
  this.shouldStartMessagesFromTop = false,
  this.messageButtonsBuilder,
  this.messagePadding = const EdgeInsets.all(8.0),
  this.textBeforeImage = true,
  this.messageDecorationBuilder,
}) : super(key: key) {
  this.scrollToBottomStyle = scrollToBottomStyle ?? new ScrollToBottomStyle();
}