DashChat constructor
DashChat({
- Key? key,
- ScrollToBottomStyle? scrollToBottomStyle,
- double avatarMaxSize = 30.0,
- TextDirection inputTextDirection = TextDirection.ltr,
- EdgeInsets inputToolbarMargin = const EdgeInsets.all(0.0),
- EdgeInsets inputToolbarPadding = const EdgeInsets.all(0.0),
- bool shouldShowLoadEarlier = false,
- Widget showLoadEarlierWidget()?,
- Function? onLoadEarlier,
- bool sendOnEnter = false,
- TextInputAction? textInputAction,
- bool scrollToBottom = true,
- Widget scrollToBottomWidget()?,
- Function? onScrollToBottomPress,
- dynamic onQuickReply()?,
- EdgeInsetsGeometry quickReplyPadding = const EdgeInsets.all(0.0),
- BoxDecoration? quickReplyStyle,
- TextStyle? quickReplyTextStyle,
- Widget quickReplyBuilder()?,
- bool quickReplyScroll = false,
- EdgeInsetsGeometry messageContainerPadding = const EdgeInsets.only(left: 2.0, right: 2.0),
- ScrollController? scrollController,
- Color? inputCursorColor,
- double inputCursorWidth = 2.0,
- bool showInputCursor = true,
- int inputMaxLines = 1,
- BoxDecoration? inputContainerStyle,
- TextStyle? inputTextStyle,
- List<
Widget> leading = const <Widget>[], - List<
Widget> trailing = const <Widget>[], - BoxDecoration? messageContainerDecoration,
- int messageContainerFlex = 1,
- double? height,
- double? width,
- bool readOnly = false,
- required List<
ChatMessage> messages, - dynamic onTextChange()?,
- String? text,
- bool inputDisabled = false,
- TextEditingController? textController,
- FocusNode? focusNode,
- InputDecoration? inputDecoration,
- TextCapitalization textCapitalization = TextCapitalization.none,
- bool alwaysShowSend = false,
- String messageIdGenerator()?,
- DateFormat? dateFormat,
- DateFormat? timeFormat,
- required ChatUser user,
- required dynamic onSend(),
- dynamic onLongPressAvatar()?,
- dynamic onLongPressMessage()?,
- dynamic onPressAvatar()?,
- Widget avatarBuilder()?,
- bool showAvatarForEveryMessage = false,
- bool showUserAvatar = false,
- bool inverted = false,
- int? maxInputLength,
- List<
MatchText> parsePatterns = const <MatchText>[], - Widget messageBuilder()?,
- Widget sendButtonBuilder()?,
- Widget dateBuilder()?,
- Widget messageImageBuilder(
- String? url, [
- ChatMessage
- Widget messageTextBuilder(
- String?, [
- ChatMessage
- Widget messageTimeBuilder(
- String formattedTime, [
- ChatMessage
- bool showTraillingBeforeSend = true,
- bool shouldStartMessagesFromTop = false,
- List<
Widget> messageButtonsBuilder()?, - EdgeInsets messagePadding = const EdgeInsets.all(8.0),
- bool textBeforeImage = true,
- BoxDecoration messageDecorationBuilder()?,
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();
}