ChatList class

Inheritance

Constructors

ChatList({Key? key, int msgCount = 0, required String onMsgKey(int index), required Widget itemBuilder(BuildContext context, int index), String? latestReadMsgKey, bool showUnreadMsgButton = true, int unreadMsgCount = 0, Position unreadMsgButtonPosition = const Position(right: 0, top: 20), Widget unreadMsgButtonBuilder(BuildContext context, int unreadCount)?, Widget unreadMsgTipBuilder(BuildContext context, int unreadCount)?, Future onLoadMsgsByLatestReadMsgKey()?, double offsetFromUnreadTipToTop = 50, bool hasMoreMsgs = false, bool hasPrevMsgs = false, double? offsetToTriggerLoadMore, double? offsetToTriggerLoadPrev, Future onLoadMoreMsgs()?, Future onLoadPrevMsgs()?, Widget loadMoreProgressBuilder(BuildContext context, LoadStatus? status)?, Widget loadPrevProgressBuilder(BuildContext context, RefreshStatus? status)?, bool showReceivedMsgButton = true, Position receivedMsgButtonPosition = const Position(right: 0, bottom: 20), Widget receivedMsgButtonBuilder(BuildContext context, int newCount)?, bool onIsReceiveMessage(int index)?, bool showScrollToTopButton = true, double offsetToShowScrollToTop = 400, Widget scrollToTopButtonBuilder(BuildContext context)?, ScrollPhysics? physics, ScrollBehavior? scrollBehavior, Future onLoadTopMsgs()?, ChatListController? controller})
const

Properties

controller ChatListController?
final
hashCode int
The hash code for this object.
no setterinherited
hasMoreMsgs bool
hasMoreMsgs is used to tell widget there are more messages need load in scroll to end offsetToTriggerLoadMore is used to tell widget when scroll offset is reach to end by loadNextMessageOffset, onLoadMoreMsgs function will invoke, null or 0 will not enable automatically invoke load function
final
hasPrevMsgs bool
Loadmore in end and loadmore in header hasPrevMsgs is used to tell widget there are more messages need load when scroll to first item offsetToTriggerLoadPrev is used to tell widget when scroll offset is reach to first item by loadPrevMessageOffset, onLoadPrevMsgs function will invoke, null or 0 will not enable automatically invoke load function
final
itemBuilder Widget Function(BuildContext context, int index)
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
latestReadMsgKey String?
latestReadMsgKey is the messages last readed null will be all message is readed If the latestReadMessage is in messages, It mean it should be in current view else it will be not in list. Does the widget show last message tip. Click it will jump to last message But if the last messages is not in current source. unreadMsgButtonBuilder is used to build the button should "Scroll to latest read message" unreadMsgTipBuilder is used to build the tip like "-------------latest read-------------" onLoadMsgsByLatestReadMsgKey if latestReadMessageKey in messages. just jump to to message. If it is not in messages, onLoadMsgsByLatestReadMsgKey will invoke to load. After load, it will also jump to the latest message When user click scroll to latest unread message. The widget will scroll to the unread item to top by offsetFromUnreadTipToTop offset
final
loadMoreProgressBuilder Widget Function(BuildContext context, LoadStatus? status)?
final
loadPrevProgressBuilder Widget Function(BuildContext context, RefreshStatus? status)?
final
msgCount int
msgCount is message count onMsgKey will return the message id itemBuilder is build message widget
final
offsetFromUnreadTipToTop double
final
offsetToShowScrollToTop double
final
offsetToTriggerLoadMore double?
final
offsetToTriggerLoadPrev double?
final
onIsReceiveMessage bool Function(int index)?
final
onLoadMoreMsgs Future Function()?
final
onLoadMsgsByLatestReadMsgKey Future Function()?
final
onLoadPrevMsgs Future Function()?
final
onLoadTopMsgs Future Function()?
When jump to top, library will detect whether the hasPrevMsgs is true, If the value is true, invoke onLoadTopMsgs to load first screen messages
final
onMsgKey String Function(int index)
final
physics ScrollPhysics?
Inherit from scrollview
final
receivedMsgButtonBuilder Widget Function(BuildContext context, int newCount)?
final
receivedMsgButtonPosition Position
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollBehavior ScrollBehavior?
final
scrollToTopButtonBuilder Widget Function(BuildContext context)?
final
showReceivedMsgButton bool
The scroll is not in top while user read messages, in this time, new message coming, Does it need should new message coming button onIsReceiveMessage Does it is received message, not send or tip message
final
showScrollToTopButton bool
showScrollToTopButton is true will determine show the scroll to top button when scroll offset > offsetToShowScrollToTop, the button will be show up
final
showUnreadMsgButton bool
final
unreadMsgButtonBuilder Widget Function(BuildContext context, int unreadCount)?
final
unreadMsgButtonPosition Position
final
unreadMsgCount int
final
unreadMsgTipBuilder Widget Function(BuildContext context, int unreadCount)?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() ChatListState
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}) 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