StreamMessageAttachmentStyle class

Visual styling properties for message attachment containers.

Defines the appearance of attachment containers including shape, border, and background color. All properties use StreamMessageLayoutProperty for placement-aware resolution. Use StreamMessageAttachmentStyle.from for uniform values across all placements.

{@tool snippet}

Uniform style:

StreamMessageAttachmentStyle.from(
  backgroundColor: Colors.grey.shade100,
  shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
  side: BorderSide(color: Colors.grey),
)

{@end-tool}

{@tool snippet}

Placement-aware style:

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

{@end-tool}

See also:

Annotations

Constructors

StreamMessageAttachmentStyle({StreamMessageLayoutProperty<Color?>? backgroundColor, StreamMessageLayoutProperty<OutlinedBorder?>? shape, StreamMessageLayoutBorderSide? side, StreamMessageLayoutProperty<EdgeInsetsGeometry?>? padding})
Creates an attachment style with optional resolver-based overrides.
const
StreamMessageAttachmentStyle.from({Color? backgroundColor, OutlinedBorder? shape, BorderSide? side, EdgeInsetsGeometry? padding})
A convenience constructor that constructs a StreamMessageAttachmentStyle given simple values.
factory

Properties

backgroundColor StreamMessageLayoutProperty<Color?>?
The background fill color of the attachment container.
final
canMerge bool
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
padding StreamMessageLayoutProperty<EdgeInsetsGeometry?>?
Padding around the attachment content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape StreamMessageLayoutProperty<OutlinedBorder?>?
The shape of the attachment container.
final
side StreamMessageLayoutBorderSide?
The border outline of the attachment container.
final

Methods

copyWith({StreamMessageLayoutProperty<Color?>? backgroundColor, StreamMessageLayoutProperty<OutlinedBorder?>? shape, StreamMessageLayoutBorderSide? side, StreamMessageLayoutProperty<EdgeInsetsGeometry?>? padding}) StreamMessageAttachmentStyle
inherited
merge(StreamMessageAttachmentStyle? other) StreamMessageAttachmentStyle
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