dash_chat使用及方法

/// Flex value for the messeage container defaults to 1

  /// Made so that the message container takes as much as possible

  /// if no height or width is passed explicity

  final int messageContainerFlex;

  /// Height for the Dash chat Widget

  final double height;

  // Width for the Dash chat Widget

  final double width;

  /// List of messages to display in the chat container

  /// Takes a [List] of [ChatMessage]

  final List messages;

  /// If provided, this text editing controller will be used for

  /// the text input.

  final TextEditingController textController;

  /// If provided, this focus node will be used for the text input.

  final FocusNode focusNode;

  /// Use to change the direction of the text ltr is used for

  /// launguages that start from left like English &

  /// rtl is used for languages like Arabic

  ///

  /// Defaults to `TextDirection.ltr`

  final TextDirection inputTextDirection;

  /// If provided will stop using the default controller

  /// i.e [TextEditingController] and will use this to update the

  /// text input field.

  final String text;

  /// If the text parameter is passed then onTextChange must also

  /// be passed.

  final Function(String) onTextChange;

  /// Used to provide input decoration to the text as default only

  /// to the input placeholder for the chat input

  /// "Add Message here...".

  final InputDecoration inputDecoration;

  ///Configures how the platform keyboard will select an uppercase or lowercase keyboard.

  ///Only supports text keyboards, other keyboard types will ignore this configuration. Capitalization is locale-aware.

  ///Defaults to [TextCapitalization.none]. Must not be null.

  final TextCapitalization textCapitalization;

  /// Usually new message added by the user gets [Uuid] String

  /// Can be override by proving this parameter

  final String Function() messageIdGenerator;

  /// The current user object [ChatUser].

  final ChatUser user;

  /// To function where you can make api calls and play

  /// with the [ChatMessage] obeject before make calls.

  final Function(ChatMessage) onSend;

  /// Should the send button be always active it defaults to false

  /// Usually it will only become active if some text is entered.

  final bool alwaysShowSend;

  /// [DateFormat] object for formatting date to show in [MessageListView]

  /// defaults to `HH:mm:ss`.

  final DateFormat dateFormat;

  /// [DateFormat] object for formatting time to show in [MessageContainer]

  /// defaults to `yyyy-MM-dd`.

  final DateFormat timeFormat;

  /// Should the user avatar be shown defaults to false and will not

  /// show the user avatar.

  final bool showUserAvatar;

  /// avatarBuilder will override the the default avatar which uses

  /// [CircleAvatar].

  final Widget Function(ChatUser) avatarBuilder;

  /// Should the avatar be shown for every message defaulst to false.

  final bool showAvatarForEveryMessage;

  /// [onPressAvatar] function takes a function with this structure

  /// [Function(ChatUser)] will trigger when the avatar

  /// is tapped on

  final Function(ChatUser) onPressAvatar;

  /// [onLongPressAvatar] function takea a function with this structure

  /// [Function(ChatUser)] will trigger when the avatar

  /// is long pressed

  final Function(ChatUser) onLongPressAvatar;

  /// [onLongPressMessage] function takea a function with this structure

  /// [Function(ChatMessage)] will trigger when the message

  /// is long pressed.

  final Function(ChatMessage) onLongPressMessage;

  /// Should the messages be shown in reversed order.

  final bool inverted;

  /// messageBuilder will override the the default chat container which uses

  /// and you will need to build complete message Widget it will not accept

  /// and include any other builder functions.

  final Widget Function(ChatMessage) messageBuilder;

  /// messageTextBuilder will override the the default message text.

  final Widget Function(String) messageTextBuilder;

  /// messageImageBuilder will override the the default Image.

  final Widget Function(String url) messageImageBuilder;

  /// messageTimeBuilder will override the the default text.

  final Widget Function(String url) messageTimeBuilder;

  /// dateBuilder will override the the default time text.

  final Widget Function(String) dateBuilder;

  /// A Widget that will be shown below the [MessageListView] like you can

  /// show a "tying..." at the end.

  final Widget Function() chatFooterBuilder;

  /// Main input length of the input text box defaulst to no limit.

  final int maxInputLength;

  /// Used to parse text to make it linkified text uses

  /// [flutter_parsed_text](https://pub.dev/packages/flutter_parsed_text)

  /// takes a list of [MatchText] in order to parse Email, phone, links

  /// and can also add custom pattersn using regex

  final List parsePatterns;

  /// Provides a custom style to the message container

  /// takes [BoxDecoration]

  final BoxDecoration messageContainerDecoration;

  /// [List] of [Widget] to show before the [TextField].

  final List leading;

  /// [List] of [Widget] to show after the [TextField].will remove the

  /// send button and will have to implement that yourself.

  final List trailing;

  /// sendButtonBuilder will override the the default [IconButton].

  final Widget Function(Function) sendButtonBuilder;

  /// Style for the [TextField].

  final TextStyle inputTextStyle;

  /// [TextField] container style.

  final BoxDecoration inputContainerStyle;

  /// Max length of the input lines default to 1.

  final int inputMaxLines;

  /// Should the input cursor be shown defaults to true.

  final bool showInputCursor;

  /// Width of the text input defaults to 2.0.

  final double inputCursorWidth;

  /// Color of the input cursor defaults to theme.

  final Color inputCursorColor;

  /// ScrollController for the [MessageListView] will use the default

  /// scrollcontroller in the Widget.

  final ScrollController scrollController;

  /// A Widget that will be shown below the [ChatInputToolbar] like you can

  /// show a list of buttons like file image just like in Slack app.

  final Widget Function() inputFooterBuilder;

  /// Padding for the [MessageListView].

  final EdgeInsetsGeometry messageContainerPadding;

  /// Callback method when the quickReply was tapped on

  /// will pass [Reply] as a paramter to function.

  final Function(Reply) onQuickReply;

  /// Container style for the QuickReply Container [BoxDecoration].

  final BoxDecoration quickReplyStyle;

  /// [TextStyle] for QuickReply textstyle.

  final TextStyle quickReplyTextStyle;

  /// quickReplyBuilder will override the the default QuickReply Widget.

  final Widget Function(Reply) quickReplyBuilder;

  /// Should the [trailling] Widgets be shown before the send button

  /// As default it will be shown before the send button.

  final bool showTraillingBeforeSend;

  /// Should the scroll to bottom widget be shown

  /// default to true.

  final bool scrollToBottom;

  /// Overrides the default [scrollToBottomWidget] with a custom widget

  final Widget Function() scrollToBottomWidget;

  /// Override the default behaviour of the onScrollToBottom Widget

  final Function onScrollToBottomPress;

  /// Should the LoadEarlier Floating widget be shown or use

  /// load as you scroll scheme whcih will call the [onLoadEarlier]

  /// function as default it is set to this scheme which is false.

  /// false - load as you scroll scheme

  /// true - shows a loadEarlier Widget

  final bool shouldShowLoadEarlier;

  /// Override the default behaviour of the onScrollToBottom Widget

  final Widget Function() showLoadEarlierWidget;

  /// Override the default behaviour of the onLoadEarleir Widget

  /// or used as a callback when the listView reaches the top

  final Function onLoadEarlier;

  /// Padding for the default input toolbar

  /// by default it padding is set 0.0

  final EdgeInsets inputToolbarPadding;

  /// Margin for the default input toolbar

  /// by default it padding is set 0.0

  final EdgeInsets inputToolbarMargin;

你可能感兴趣的:(dash_chat使用及方法)