MessageContainer class

Lays out a message bubble with its timestamp, read indicator, loading state, failed-message actions and context menu.

Inheritance

Constructors

MessageContainer({Key? key, required Message message, required bool isBaseAxisStart, required Widget bubbleBuilder(BuildContext context, Widget child, bool isSender), required Widget timeBuilder(BuildContext context, String timestamp), required bool isSender, required double maxWidth, bool showTime = true, Widget loadingWidget = const MessageLoading(), Widget readIndicatorBuilder(BuildContext context, bool isRead)?, VoidCallback? onDelete, VoidCallback? onRetry, BubbleMenuConfiguration? menuConfiguration})
Creates a MessageContainer.
const

Properties

bubbleBuilder → Widget Function(BuildContext context, Widget child, bool isSender)
Wraps the message content in a bubble.
final
hashCode → int
The hash code for this object.
no setterinherited
isBaseAxisStart → bool
Whether the bubble is aligned to the leading side.
final
isSender → bool
Whether the message is a sender message.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingWidget → Widget
Shown inside the bubble while the message is loading.
final
maxWidth → double
Maximum width of the bubble.
final
Context-menu settings. null disables the menu.
final
message → Message
The message to display.
final
onDelete → VoidCallback?
Called when the delete button of a failed message is tapped.
final
onRetry → VoidCallback?
Called when the retry button of a failed message is tapped.
final
readIndicatorBuilder → Widget Function(BuildContext context, bool isRead)?
Builds the read indicator. null hides it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showTime → bool
Whether to show the timestamp.
final
timeBuilder → Widget Function(BuildContext context, String timestamp)
Builds the timestamp.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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