StreamMessageMetadataStyle class

Visual styling properties for a message metadata row.

Defines the appearance of metadata rows including username, timestamp, edited indicator, status icon, and spacing. All properties use StreamMessageLayoutProperty for placement-aware resolution. Use StreamMessageMetadataStyle.from for uniform values across all placements.

{@tool snippet}

Uniform style:

StreamMessageMetadataStyle.from(
  usernameColor: Colors.blue,
  timestampColor: Colors.grey,
  spacing: 12,
)

{@end-tool}

{@tool snippet}

Placement-aware style:

StreamMessageMetadataStyle(
  usernameColor: StreamMessageLayoutProperty.resolveWith((p) {
    final isEnd = p.alignment == StreamMessageAlignment.end;
    return isEnd ? Colors.blue : Colors.grey;
  }),
)

{@end-tool}

See also:

Annotations

Constructors

StreamMessageMetadataStyle({StreamMessageLayoutProperty<TextStyle?>? usernameTextStyle, StreamMessageLayoutProperty<Color?>? usernameColor, StreamMessageLayoutProperty<TextStyle?>? timestampTextStyle, StreamMessageLayoutProperty<Color?>? timestampColor, StreamMessageLayoutProperty<TextStyle?>? editedTextStyle, StreamMessageLayoutProperty<Color?>? editedColor, StreamMessageLayoutProperty<TextStyle?>? statusTextStyle, StreamMessageLayoutProperty<Color?>? statusColor, StreamMessageLayoutProperty<double?>? statusIconSize, StreamMessageLayoutProperty<double?>? spacing, StreamMessageLayoutProperty<double?>? statusSpacing, StreamMessageLayoutProperty<double?>? minHeight})
Creates a metadata style with optional resolver-based overrides.
const
StreamMessageMetadataStyle.from({TextStyle? usernameTextStyle, Color? usernameColor, TextStyle? timestampTextStyle, Color? timestampColor, TextStyle? editedTextStyle, Color? editedColor, TextStyle? statusTextStyle, Color? statusColor, double? statusIconSize, double? spacing, double? statusSpacing, double? minHeight})
A convenience constructor that constructs a StreamMessageMetadataStyle given simple values.
factory

Properties

canMerge bool
no setterinherited
editedColor StreamMessageLayoutProperty<Color?>?
The color for the edited indicator text.
final
editedTextStyle StreamMessageLayoutProperty<TextStyle?>?
The text style for the edited indicator.
final
hashCode int
The hash code for this object.
no setterinherited
minHeight StreamMessageLayoutProperty<double?>?
The minimum height of the metadata row.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spacing StreamMessageLayoutProperty<double?>?
The gap between main elements (username, timestamp group, edited).
final
statusColor StreamMessageLayoutProperty<Color?>?
The color for the status icon or text.
final
statusIconSize StreamMessageLayoutProperty<double?>?
The size for the status icon.
final
statusSpacing StreamMessageLayoutProperty<double?>?
The gap between the status icon and the timestamp.
final
statusTextStyle StreamMessageLayoutProperty<TextStyle?>?
The text style for the status text.
final
timestampColor StreamMessageLayoutProperty<Color?>?
The color for the timestamp text.
final
timestampTextStyle StreamMessageLayoutProperty<TextStyle?>?
The text style for the timestamp.
final
usernameColor StreamMessageLayoutProperty<Color?>?
The color for the username text.
final
usernameTextStyle StreamMessageLayoutProperty<TextStyle?>?
The text style for the username.
final

Methods

copyWith({StreamMessageLayoutProperty<TextStyle?>? usernameTextStyle, StreamMessageLayoutProperty<Color?>? usernameColor, StreamMessageLayoutProperty<TextStyle?>? timestampTextStyle, StreamMessageLayoutProperty<Color?>? timestampColor, StreamMessageLayoutProperty<TextStyle?>? editedTextStyle, StreamMessageLayoutProperty<Color?>? editedColor, StreamMessageLayoutProperty<TextStyle?>? statusTextStyle, StreamMessageLayoutProperty<Color?>? statusColor, StreamMessageLayoutProperty<double?>? statusIconSize, StreamMessageLayoutProperty<double?>? spacing, StreamMessageLayoutProperty<double?>? statusSpacing, StreamMessageLayoutProperty<double?>? minHeight}) StreamMessageMetadataStyle
inherited
merge(StreamMessageMetadataStyle? other) StreamMessageMetadataStyle
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

lerp(StreamMessageMetadataStyle? a, StreamMessageMetadataStyle? b, double t) StreamMessageMetadataStyle?
Linearly interpolate between two StreamMessageMetadataStyle objects.