lerp method

Linearly interpolate from one StreamMessageThemeData to another.

Implementation

StreamMessageThemeData lerp(
  StreamMessageThemeData a,
  StreamMessageThemeData b,
  double t,
) {
  return StreamMessageThemeData(
    avatarTheme:
        const StreamAvatarThemeData().lerp(a.avatarTheme!, b.avatarTheme!, t),
    createdAtStyle: TextStyle.lerp(a.createdAtStyle, b.createdAtStyle, t),
    messageAuthorStyle:
        TextStyle.lerp(a.messageAuthorStyle, b.messageAuthorStyle, t),
    messageBackgroundColor:
        Color.lerp(a.messageBackgroundColor, b.messageBackgroundColor, t),
    messageBorderColor:
        Color.lerp(a.messageBorderColor, b.messageBorderColor, t),
    messageLinksStyle:
        TextStyle.lerp(a.messageLinksStyle, b.messageLinksStyle, t),
    messageTextStyle:
        TextStyle.lerp(a.messageTextStyle, b.messageTextStyle, t),
    reactionsBackgroundColor: Color.lerp(
      a.reactionsBackgroundColor,
      b.reactionsBackgroundColor,
      t,
    ),
    reactionsBorderColor:
        Color.lerp(a.messageBorderColor, b.reactionsBorderColor, t),
    reactionsMaskColor:
        Color.lerp(a.reactionsMaskColor, b.reactionsMaskColor, t),
    repliesStyle: TextStyle.lerp(a.repliesStyle, b.repliesStyle, t),
    urlAttachmentBackgroundColor: Color.lerp(
      a.urlAttachmentBackgroundColor,
      b.urlAttachmentBackgroundColor,
      t,
    ),
    urlAttachmentHostStyle:
        TextStyle.lerp(a.urlAttachmentHostStyle, b.urlAttachmentHostStyle, t),
    urlAttachmentTextStyle: TextStyle.lerp(
      a.urlAttachmentTextStyle,
      b.urlAttachmentTextStyle,
      t,
    ),
    urlAttachmentTitleStyle: TextStyle.lerp(
      a.urlAttachmentTitleStyle,
      b.urlAttachmentTitleStyle,
      t,
    ),
    urlAttachmentTitleMaxLine: lerpDouble(
      a.urlAttachmentTitleMaxLine,
      b.urlAttachmentTitleMaxLine,
      t,
    )?.round(),
    urlAttachmentTextMaxLine: lerpDouble(
      a.urlAttachmentTextMaxLine,
      b.urlAttachmentTextMaxLine,
      t,
    )?.round(),
  );
}