StreamMessageWidget constructor

const StreamMessageWidget({
  1. Key? key,
  2. required Message message,
  3. required StreamMessageThemeData messageTheme,
  4. bool reverse = false,
  5. bool translateUserAvatar = true,
  6. ShapeBorder? shape,
  7. BorderSide? borderSide,
  8. BorderRadiusGeometry? borderRadiusGeometry,
  9. ShapeBorder? attachmentShape,
  10. void onMentionTap(
    1. User
    )?,
  11. void onMessageTap(
    1. Message
    )?,
  12. OnReactionsTap? onReactionsTap,
  13. OnReactionsHover? onReactionsHover,
  14. bool showReactionPicker = true,
  15. DisplayWidget showUserAvatar = DisplayWidget.show,
  16. bool showSendingIndicator = true,
  17. bool showThreadReplyIndicator = false,
  18. bool showInChannelIndicator = false,
  19. void onReplyTap(
    1. Message
    )?,
  20. void onThreadTap(
    1. Message
    )?,
  21. Future<void> onConfirmDeleteTap(
    1. Message
    )?,
  22. bool showUsername = true,
  23. bool showTimestamp = true,
  24. bool showReactions = true,
  25. bool showDeleteMessage = true,
  26. bool showEditMessage = true,
  27. bool showReplyMessage = true,
  28. bool showThreadReplyMessage = true,
  29. bool showMarkUnreadMessage = true,
  30. bool showResendMessage = true,
  31. bool showCopyMessage = true,
  32. bool showFlagButton = true,
  33. bool showPinButton = true,
  34. bool showPinHighlight = true,
  35. void onUserAvatarTap(
    1. User
    )?,
  36. void onLinkTap(
    1. String
    )?,
  37. void onMessageActions(
    1. BuildContext,
    2. Message
    )?,
  38. ShowMessageCallback? onShowMessage,
  39. Widget userAvatarBuilder(
    1. BuildContext,
    2. User
    )?,
  40. Widget quotedMessageBuilder(
    1. BuildContext,
    2. Message
    )?,
  41. Widget editMessageInputBuilder(
    1. BuildContext,
    2. Message
    )?,
  42. Widget textBuilder(
    1. BuildContext,
    2. Message
    )?,
  43. BottomRowBuilderWithDefaultWidget? bottomRowBuilderWithDefaultWidget,
  44. List<StreamAttachmentWidgetBuilder>? attachmentBuilders,
  45. EdgeInsetsGeometry? padding,
  46. EdgeInsets textPadding = const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
  47. EdgeInsetsGeometry attachmentPadding = EdgeInsets.zero,
  48. double widthFactor = 0.78,
  49. OnQuotedMessageTap? onQuotedMessageTap,
  50. List<StreamMessageAction> customActions = const [],
  51. StreamAttachmentWidgetTapCallback? onAttachmentTap,
  52. Size imageAttachmentThumbnailSize = const Size(400, 400),
  53. String imageAttachmentThumbnailResizeType = 'clip',
  54. String imageAttachmentThumbnailCropType = 'center',
  55. AttachmentActionsBuilder? attachmentActionsModalBuilder,
})

screenshot screenshot

Shows a message with reactions, replies and user avatar.

Usually you don't use this widget as it's the default message widget used by MessageListView.

The widget components render the ui based on the first ancestor of type StreamChatTheme. Modify it to change the widget appearance.

Implementation

const StreamMessageWidget({
  super.key,
  required this.message,
  required this.messageTheme,
  this.reverse = false,
  this.translateUserAvatar = true,
  this.shape,
  this.borderSide,
  this.borderRadiusGeometry,
  this.attachmentShape,
  this.onMentionTap,
  this.onMessageTap,
  this.onReactionsTap,
  this.onReactionsHover,
  this.showReactionPicker = true,
  this.showUserAvatar = DisplayWidget.show,
  this.showSendingIndicator = true,
  this.showThreadReplyIndicator = false,
  this.showInChannelIndicator = false,
  this.onReplyTap,
  this.onThreadTap,
  this.onConfirmDeleteTap,
  this.showUsername = true,
  this.showTimestamp = true,
  this.showReactions = true,
  this.showDeleteMessage = true,
  this.showEditMessage = true,
  this.showReplyMessage = true,
  this.showThreadReplyMessage = true,
  this.showMarkUnreadMessage = true,
  this.showResendMessage = true,
  this.showCopyMessage = true,
  this.showFlagButton = true,
  this.showPinButton = true,
  this.showPinHighlight = true,
  this.onUserAvatarTap,
  this.onLinkTap,
  this.onMessageActions,
  this.onShowMessage,
  this.userAvatarBuilder,
  this.quotedMessageBuilder,
  this.editMessageInputBuilder,
  this.textBuilder,
  this.bottomRowBuilderWithDefaultWidget,
  this.attachmentBuilders,
  this.padding,
  this.textPadding = const EdgeInsets.symmetric(
    horizontal: 16,
    vertical: 8,
  ),
  this.attachmentPadding = EdgeInsets.zero,
  this.widthFactor = 0.78,
  this.onQuotedMessageTap,
  this.customActions = const [],
  this.onAttachmentTap,
  this.imageAttachmentThumbnailSize = const Size(400, 400),
  this.imageAttachmentThumbnailResizeType = 'clip',
  this.imageAttachmentThumbnailCropType = 'center',
  this.attachmentActionsModalBuilder,
});