MessagesView class

消息页面

Inheritance

Constructors

MessagesView({required ChatUIKitProfile profile, ChatUIKitAppBarModel? appBarModel, bool enableAppBar = true, Widget? inputBar, MessagesViewController? controller, MessageItemShowHandler? showMessageItemAvatar, MessageItemShowHandler? showMessageItemNickname, MessageItemGlobalPositionTapHandler? onItemTap, MessagesViewItemLongPressPositionHandler? onItemLongPressHandler, MessageItemGlobalPositionTapHandler? onDoubleTap, MessageItemTapHandler? onAvatarTap, MessageItemTapHandler? onAvatarLongPress, MessageItemTapHandler? onNicknameTap, Widget? emojiWidget, MessageItemBuilder? itemBuilder, MessageItemBuilder? alertItemBuilder, List<ChatUIKitEventAction>? morePressActions, MessagesViewMorePressHandler? onMoreActionsItemsHandler, Widget? replyBarBuilder(BuildContext context, MessageModel replyMessage)?, Widget quoteBuilder(BuildContext context, QuoteModel model)?, MessageItemTapHandler? onErrorBtnTapHandler, MessageItemBubbleBuilder? bubbleBuilder, MessageItemBuilder? bubbleContentBuilder, bool? forceLeft, ChatUIKitKeyboardPanelController? inputController, Widget? multiSelectBottomBar, ChatUIKitViewObserver? viewObserver, String? attributes, MessageReactionItemTapHandler? onReactionItemTap, MessageItemTapHandler? onReactionInfoTap, MessageItemBuilder? reactionItemsBuilder, MessageItemTapHandler? onThreadItemTap, MessageItemBuilder? threadItemBuilder, Widget? backgroundWidget, Key? key})
构造函数。
const
MessagesView.arguments(MessagesViewArguments arguments, {Key? key})
构造函数, 通过 MessagesViewArguments 传入参数。详细参考 MessagesViewArguments

Properties

alertItemBuilder MessageItemBuilder?
提示消息构建器, 如果设置后需要显示提示消息时会直接回调,如果不处理可以返回 null
final
appBarModel ChatUIKitAppBarModel?
final
attributes String?
View 附加属性,设置后的内容将会带入到下一个页面。
final
backgroundWidget Widget?
背景组件,如果设置后将会替换默认的背景组件。
final
bubbleBuilder MessageItemBubbleBuilder?
气泡构建器,如果设置后将会替换默认的气泡构建器。详细参考 MessageItemBubbleBuilder
final
bubbleContentBuilder MessageItemBuilder?
气泡内容构建器,如果设置后将会替换默认的气泡内容构建器。详细参考 MessageItemBuilder
final
controller MessagesViewController?
消息列表控制器,用于控制消息列表和收发消息等,如果不设置将会自动创建。详细参考 MessagesViewController
final
emojiWidget Widget?
表情控件,如果设置后将会替换默认的表情控件。详细参考 ChatUIKitEmojiPanel
final
enableAppBar bool
是否显示AppBar, 默认为 true。 当为 false 时将不会显示AppBar。同时也会影响到是否显示标题。
final
forceLeft bool?
强制消息靠左,默认为 false, 设置后自己发的消息也会在左侧显示。
final
hashCode int
The hash code for this object.
no setterinherited
inputBar Widget?
自定义输入框, 如果设置后将会替换默认的输入框。详细参考 ChatUIKitInputBar
final
inputController ChatUIKitKeyboardPanelController?
输入框控制器,如果设置后将会替换默认的输入框控制器。详细参考 ChatUIKitKeyboardPanelController
final
itemBuilder MessageItemBuilder?
消息 item 构建器, 如果设置后需要显示消息时会直接回调,如果不处理可以返回 null
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
morePressActions List<ChatUIKitEventAction>?
更多按钮点击事件列表,如果设置后将会替换默认的更多按钮点击事件列表。详细参考 ChatUIKitEventAction
final
multiSelectBottomBar Widget?
多选时显示的 bottom bar
final
onAvatarLongPress MessageItemTapHandler?
头像长按事件,如果设置后头像长按事件将直接回调,如果不处理可以返回 false
final
onAvatarTap MessageItemTapHandler?
头像点击事件,如果设置后头像点击事件将直接回调,如果不处理可以返回 false
final
onDoubleTap MessageItemGlobalPositionTapHandler?
消息双击事件,如果设置后消息双击事件将直接回调,如果不处理可以返回 false
final
onErrorBtnTapHandler MessageItemTapHandler?
错误消息点击事件,如果设置后将会替换默认的错误消息点击事件。如果不处理可以返回 false。默认行为为重新发送消息。
final
onItemLongPressHandler MessagesViewItemLongPressPositionHandler?
消息长按事件回调, 如果设置后将会替换默认的消息长按事件回调。
final
onItemTap MessageItemGlobalPositionTapHandler?
消息点击事件, 如果设置后消息点击事件将直接回调,如果不处理可以返回 false
final
onMoreActionsItemsHandler MessagesViewMorePressHandler?
更多按钮点击事件, 如果设置后将会替换默认的更多按钮点击事件。详细参考 ChatUIKitEventAction
final
onNicknameTap MessageItemTapHandler?
昵称点击事件, 如果设置后昵称点击事件将直接回调,如果不处理可以返回 false
final
onReactionInfoTap MessageItemTapHandler?
reaction 点击事件,如果设置后将会替换默认的反应信息点击事件。详细参考 MessageItemTapHandler
final
onReactionItemTap MessageReactionItemTapHandler?
reaction 点击事件,如果设置后将会替换默认的反应点击事件。详细参考 MessageReactionItemTapHandler
final
onThreadItemTap MessageItemTapHandler?
thread 点击事件,如果设置后将会替换默认的线程点击事件。详细参考 MessageItemTapHandler
final
profile ChatUIKitProfile
用户信息对象,用于设置对方信息。详细参考 ChatUIKitProfile
final
quoteBuilder Widget Function(BuildContext context, QuoteModel model)?
引用消息构建器,如果设置后将会替换默认的引用消息样式。
final
reactionItemsBuilder MessageItemBuilder?
reaction 构建器,如果设置后将会替换默认的反应构建器。详细参考 MessageItemBuilder
final
replyBarBuilder Widget? Function(BuildContext context, MessageModel replyMessage)?
回复消息提示组件构建器,如果设置后将会替换默认的回复消息提示组件。详细参考 ChatUIKitReplyBar
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showMessageItemAvatar MessageItemShowHandler?
是否显示头像, 默认为 true。 如果设置为 false 将不会显示头像。
final
showMessageItemNickname MessageItemShowHandler?
是否显示昵称, 默认为 true。如果设置为 false 将不会显示昵称。
final
threadItemBuilder MessageItemBuilder?
thread 构建器,如果设置后将会替换默认的线程构建器。详细参考 MessageItemBuilder
final
viewObserver ChatUIKitViewObserver?
用于刷新页面的Observer
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MessagesView>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited