builder method

  1. @override
Widget builder(
  1. BuildContext ctx,
  2. bool showUserAvatar,
  3. bool showMessageStatus,
  4. bool showUsername,
  5. User loggedInUser,
  6. ChatTheme theme,
  7. AuthorDetailsLocation authorDetailsLocation,
)
override

Implementation

@override
Widget builder(
    BuildContext ctx,
    bool showUserAvatar,
    bool showMessageStatus,
    bool showUsername,
    User loggedInUser,
    ChatTheme theme,
    AuthorDetailsLocation authorDetailsLocation) {
  return MessageContainer(
    parentContext: ctx,
    message: this,
    theme: theme,
    showUserAvatar: showUserAvatar,
    showMessageStatus: showMessageStatus,
    showUsername: showUsername,
    user: loggedInUser,
    detailsLocation: authorDetailsLocation,
    child: Padding(
      padding: theme.messagePadding,
      child: TextContainer(
        text: text,
        style: author.id == loggedInUser.id
            ? theme.outwardMessageTextStyle
            : theme.inwardMessageTextStyle,
        linkStyle: theme.urlTextStyle,
      ),
    ),
  );
}