ChatMessageList class

A widget that displays a scrollable list of chat messages between two users.

Supports message selection, deletion, custom message bubbles, and loading more messages.

Inheritance
Available extensions

Constructors

ChatMessageList.new({required bool enableDeleteMessage, required String senderId, required String receiverId, required bool enableDivider, int initialChatLimit = 15, dynamic getLastSeen(DateTime lastSeen)?, dynamic onDeleteMessage()?, Widget dividerBuilder(String label)?, Widget messageBubbleBuilder({required bool isMe, required Message message})?, EdgeInsets? listPadding, Key? key, void onMessageSelected({required void deselectAll(), required List<Message> messages})?})
Creates a ChatMessageList widget.
const

Properties

dividerBuilder Widget Function(String label)?
Divide chat date-vise, label will be the divided date.
final
enableDeleteMessage bool
Optional callback for sending selected messages.
final
enableDivider bool
Enable/disable date-vise divider. Default value will be true
final
getLastSeen → dynamic Function(DateTime lastSeen)?
Optional callback to provide the last seen time of the receiver.
final
hashCode int
The hash code for this object.
no setterinherited
initialChatLimit int
The initial number of chat messages to load.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listPadding EdgeInsets?
The padding to apply around the message list.
final
messageBubbleBuilder Widget Function({required bool isMe, required Message message})?
Optional builder for customizing the message bubble widget.
final
onDeleteMessage → dynamic Function()?
Optional callback for when a message is deleted.
final
onMessageSelected → void Function({required void deselectAll(), required List<Message> messages})?
Optional callback for when messages are selected.
final
receiverId String
The ID of the user receiving messages.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
senderId String
The ID of the user sending messages.
final

Methods

box({double? height, double? width, Alignment alignment = Alignment.centerLeft}) Widget

Available on Widget, provided by the WrapIt extension

Wraps the widget in a Container with optional height, width, and alignment.
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ChatMessageList>
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