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) {
  Widget returnValue = Padding(
    padding: const EdgeInsets.all(10),
    child: Column(
      children: [
        Container(
          padding: const EdgeInsets.all(10),
          decoration: BoxDecoration(
            color: const Color(0xff171b1d),
            borderRadius: BorderRadius.circular(10),
          ),
          child: Row(
            children: [
              Iconify(
                Ion.document_text,
                color: theme.primaryColor,
              ),
              const SizedBox(
                width: 10,
              ),
              Expanded(
                child: Text(
                  documentName,
                  style: const TextStyle(
                    color: Colors.grey,
                    fontWeight: FontWeight.w500,
                  ),
                  maxLines: 1,
                  overflow: TextOverflow.ellipsis,
                ),
              )
            ],
          ),
        ),
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              documentFormat,
              style: const TextStyle(
                color: Colors.grey,
                fontSize: 12,
              ),
            ),
            Text(
              documentSize,
              style: const TextStyle(
                color: Colors.grey,
                fontSize: 12,
              ),
            ),
          ],
        )
      ],
    ),
  );
  return MessageContainer(
    parentContext: ctx,
    message: this,
    theme: theme,
    showUserAvatar: showUserAvatar,
    showMessageStatus: showMessageStatus,
    showUsername: showUsername,
    user: loggedInUser,
    child: returnValue,
    detailsLocation: authorDetailsLocation,
  );
}