StreamMessageLayoutData class

The layout data for a message.

Combines positional properties — alignment (start vs end), stackPosition (single, top, middle, bottom) — with environmental context — channelKind (direct vs group), listKind (channel vs thread), presentation (standard vs preview) — and content classification — contentKind (standard, singleAttachment, jumbomoji) — into a single value that StreamMessageLayoutProperty resolvers use to compute layout-dependent styling.

{@tool snippet}

Create layout data for an end-aligned, single image message at the top of a stack in a group channel:

const layout = StreamMessageLayoutData(
  alignment: StreamMessageAlignment.end,
  stackPosition: StreamMessageStackPosition.top,
  channelKind: StreamMessageChannelKind.group,
  listKind: StreamMessageListKind.channel,
  contentKind: StreamMessageContentKind.singleAttachment,
  presentation: StreamMessagePresentation.standard,
);

print(layout.alignment);       // StreamMessageAlignment.end
print(layout.stackPosition);   // StreamMessageStackPosition.top
print(layout.channelKind);     // StreamMessageChannelKind.group
print(layout.listKind);        // StreamMessageListKind.channel
print(layout.contentKind);     // StreamMessageContentKind.singleAttachment
print(layout.presentation);    // StreamMessagePresentation.standard

{@end-tool}

See also:

Annotations

Constructors

StreamMessageLayoutData({StreamMessageAlignment alignment = .start, StreamMessageStackPosition stackPosition = .single, StreamMessageChannelKind channelKind = .group, StreamMessageListKind listKind = .channel, StreamMessageContentKind contentKind = .standard, StreamMessagePresentation presentation = .standard})
Creates message layout data.
const

Properties

alignment StreamMessageAlignment
The horizontal alignment of the message.
final
channelKind StreamMessageChannelKind
The kind of channel this message is displayed in.
final
contentKind StreamMessageContentKind
The kind of content this message carries.
final
hashCode int
The hash code for this object.
no setteroverride
listKind StreamMessageListKind
The kind of list this message is displayed in.
final
presentation StreamMessagePresentation
How this message is presented to the user.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackPosition StreamMessageStackPosition
The position of the message within a consecutive stack.
final

Methods

copyWith({StreamMessageAlignment? alignment, StreamMessageStackPosition? stackPosition, StreamMessageChannelKind? channelKind, StreamMessageListKind? listKind, StreamMessageContentKind? contentKind, StreamMessagePresentation? presentation}) StreamMessageLayoutData
Returns a copy of this StreamMessageLayoutData with the given fields replaced with new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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