StreamMessageAnnotationStyle class
Visual styling properties for a message annotation row.
Defines the appearance of annotation rows including text, icons, spacing, and padding. All properties use StreamMessageLayoutProperty for placement-aware resolution. Use StreamMessageAnnotationStyle.from for uniform values across all placements.
{@tool snippet}
Uniform style:
StreamMessageAnnotationStyle.from(
textColor: Colors.purple,
iconColor: Colors.purple,
iconSize: 18,
spacing: 8,
)
{@end-tool}
{@tool snippet}
Placement-aware style:
StreamMessageAnnotationStyle(
textColor: StreamMessageLayoutProperty.resolveWith((p) {
final isEnd = p.alignment == StreamMessageAlignment.end;
return isEnd ? Colors.blue : Colors.grey;
}),
)
{@end-tool}
See also:
- StreamMessageItemThemeData, which wraps this style for theming.
- StreamMessageAnnotation, which uses this styling.
- Annotations
-
- @themeGen
- @immutable
Constructors
-
StreamMessageAnnotationStyle({StreamMessageLayoutProperty<
TextStyle?> ? textStyle, StreamMessageLayoutProperty<Color?> ? textColor, StreamMessageLayoutProperty<Color?> ? iconColor, StreamMessageLayoutProperty<double?> ? iconSize, StreamMessageLayoutProperty<double?> ? spacing, StreamMessageLayoutProperty<EdgeInsetsGeometry?> ? padding, StreamMessageLayoutProperty<TextStyle?> ? trailingTextStyle, StreamMessageLayoutProperty<Color?> ? trailingTextColor}) -
Creates an annotation style with optional resolver-based overrides.
const
- StreamMessageAnnotationStyle.from({TextStyle? textStyle, Color? textColor, Color? iconColor, double? iconSize, double? spacing, EdgeInsetsGeometry? padding, TextStyle? trailingTextStyle, Color? trailingTextColor})
-
A convenience constructor that constructs a
StreamMessageAnnotationStyle given simple values.
factory
Properties
- canMerge → bool
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
iconColor
→ StreamMessageLayoutProperty<
Color?> ? -
The color for the leading icon.
final
-
iconSize
→ StreamMessageLayoutProperty<
double?> ? -
The size for the leading icon.
final
-
padding
→ StreamMessageLayoutProperty<
EdgeInsetsGeometry?> ? -
The padding around the annotation row content.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
spacing
→ StreamMessageLayoutProperty<
double?> ? -
The gap between the leading widget and label.
final
-
textColor
→ StreamMessageLayoutProperty<
Color?> ? -
The color for the annotation label text.
final
-
textStyle
→ StreamMessageLayoutProperty<
TextStyle?> ? -
The text style for the annotation label.
final
-
trailingTextColor
→ StreamMessageLayoutProperty<
Color?> ? -
The color for the trailing widget.
final
-
trailingTextStyle
→ StreamMessageLayoutProperty<
TextStyle?> ? -
The text style for the trailing widget.
final
Methods
-
copyWith(
{StreamMessageLayoutProperty< TextStyle?> ? textStyle, StreamMessageLayoutProperty<Color?> ? textColor, StreamMessageLayoutProperty<Color?> ? iconColor, StreamMessageLayoutProperty<double?> ? iconSize, StreamMessageLayoutProperty<double?> ? spacing, StreamMessageLayoutProperty<EdgeInsetsGeometry?> ? padding, StreamMessageLayoutProperty<TextStyle?> ? trailingTextStyle, StreamMessageLayoutProperty<Color?> ? trailingTextColor}) → StreamMessageAnnotationStyle -
inherited
-
merge(
StreamMessageAnnotationStyle? other) → StreamMessageAnnotationStyle -
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(
StreamMessageAnnotationStyle? a, StreamMessageAnnotationStyle? b, double t) → StreamMessageAnnotationStyle? - Linearly interpolate between two StreamMessageAnnotationStyle objects.