StreamMessageAnnotationStyle.from constructor

StreamMessageAnnotationStyle.from({
  1. TextStyle? textStyle,
  2. Color? textColor,
  3. Color? iconColor,
  4. double? iconSize,
  5. double? spacing,
  6. EdgeInsetsGeometry? padding,
  7. TextStyle? trailingTextStyle,
  8. Color? trailingTextColor,
})

A convenience constructor that constructs a StreamMessageAnnotationStyle given simple values.

All parameters default to null. By default this constructor returns a StreamMessageAnnotationStyle that doesn't override anything.

For example, to override the default annotation text and icon colors, one could write:

StreamMessageAnnotationStyle.from(
  textColor: Colors.purple,
  iconColor: Colors.purple,
)

Implementation

factory StreamMessageAnnotationStyle.from({
  TextStyle? textStyle,
  Color? textColor,
  Color? iconColor,
  double? iconSize,
  double? spacing,
  EdgeInsetsGeometry? padding,
  TextStyle? trailingTextStyle,
  Color? trailingTextColor,
}) {
  return StreamMessageAnnotationStyle(
    textStyle: textStyle?.let(StreamMessageLayoutProperty.all),
    textColor: textColor?.let(StreamMessageLayoutProperty.all),
    iconColor: iconColor?.let(StreamMessageLayoutProperty.all),
    iconSize: iconSize?.let(StreamMessageLayoutProperty.all),
    spacing: spacing?.let(StreamMessageLayoutProperty.all),
    padding: padding?.let(StreamMessageLayoutProperty.all),
    trailingTextStyle: trailingTextStyle?.let(StreamMessageLayoutProperty.all),
    trailingTextColor: trailingTextColor?.let(StreamMessageLayoutProperty.all),
  );
}