StreamMessageListView class

screenshot screenshot

Shows the list of messages in the current channel.

class ChannelPage extends StatelessWidget {
  const ChannelPage({
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: StreamChannelHeader(),
      body: Column(
        children: <Widget>[
          Expanded(
            child: StreamMessageListView(
              threadBuilder: (_, parentMessage) {
                return ThreadPage(
                  parent: parentMessage,
                );
              },
            ),
          ),
          StreamMessageComposer(),
        ],
      ),
    );
  }
}

A StreamChannel ancestor widget is required in order to provide the information about the channels.

Uses a ScrollablePositionedList to render the list of channels.

The UI is rendered based on the first ancestor of type StreamChatTheme. Modify it to change the widget's appearance.

Inheritance

Constructors

StreamMessageListView({Key? key, bool messageFilter(Message)?, StreamMessageItemBuilder? messageBuilder, Message? parentMessage, int? initialScrollIndex, double? initialAlignment, MessageListController? messageListController, ItemScrollController? scrollController, ItemPositionsListener? itemPositionListener, ThreadBuilder? threadBuilder, ThreadTapCallback? onThreadTap, OnMessageTap? onMessageTap, void onViewInChannelTap(Message message)?, void onEditMessageTap(Message)?, void onReplyTap(Message)?, void onUserAvatarTap(User)?, void onReactionsTap(Message)?, void onQuotedMessageTap(Message quotedMessage)?, void onMessageLinkTap(Message message, String url)?, void onUserMentionTap(User user)?, OnMessageTap? onSystemMessageTap, OnMessageTap? onEphemeralMessageTap, OnMessageTap? onModeratedMessageTap, OnMessageLongPress? onMessageLongPress, StreamMessageListViewConfiguration config = const StreamMessageListViewConfiguration(), StreamMessageListViewBuilders builders = const StreamMessageListViewBuilders()})
screenshot screenshot
const

Properties

builders StreamMessageListViewBuilders
Custom slot builders for this message list view.
final
config StreamMessageListViewConfiguration
Behavior flags for this message list view.
final
hashCode int
The hash code for this object.
no setterinherited
initialAlignment double?
Determines where the leading edge of the item at initialScrollIndex should be placed.
final
initialScrollIndex int?
Index of an item to initially align within the viewport.
final
itemPositionListener ItemPositionsListener?
Provides a listenable iterable of itemPositions of items that are on screen and their locations.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
messageBuilder StreamMessageItemBuilder?
Optional builder for per-instance message customization.
final
messageFilter bool Function(Message)?
Predicate used to filter messages.
final
messageListController MessageListController?
A MessageListController allows pagination.
final
onEditMessageTap → void Function(Message)?
If provided, the inline edit flow is used instead of the edit bottom sheet.
final
onEphemeralMessageTap OnMessageTap?
Called when ephemeral message is tapped.
final
onMessageLinkTap → void Function(Message message, String url)?
Called when a link is tapped in message text.
final
onMessageLongPress OnMessageLongPress?
Called when a regular message is long pressed.
final
onMessageTap OnMessageTap?
Called when a regular message is tapped.
final
onModeratedMessageTap OnMessageTap?
Called when moderated message is tapped.
final
onQuotedMessageTap → void Function(Message quotedMessage)?
Called when a quoted message is tapped.
final
onReactionsTap → void Function(Message)?
Called when the message reactions are tapped.
final
onReplyTap → void Function(Message)?
Called when the reply action is triggered on a message.
final
onSystemMessageTap OnMessageTap?
Called when system message is tapped.
final
onThreadTap ThreadTapCallback?
The action to perform when threads are tapped.
final
onUserAvatarTap → void Function(User)?
Called when a user avatar is tapped.
final
onUserMentionTap → void Function(User user)?
Called when a user mention is tapped in message text.
final
onViewInChannelTap → void Function(Message message)?
Called when the "View" button on the "Also sent in channel" annotation is tapped inside a thread view.
final
parentMessage Message?
Parent message in case of a thread.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ItemScrollController?
Controller for jumping or scrolling to an item.
final
threadBuilder ThreadBuilder?
A widget builder for creating custom thread UI.
final

Methods

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