Chat constructor

const Chat({
  1. Key? key,
  2. Widget audioMessageBuilder(
    1. AudioMessage, {
    2. required int messageWidth,
    })?,
  3. Widget avatarBuilder(
    1. String userId
    )?,
  4. Widget bubbleBuilder(
    1. Widget child, {
    2. required Message message,
    3. required bool nextMessageInGroup,
    })?,
  5. BubbleRtlAlignment? bubbleRtlAlignment = BubbleRtlAlignment.right,
  6. Widget? customBottomWidget,
  7. String customDateHeaderText(
    1. DateTime
    )?,
  8. Widget customMessageBuilder(
    1. CustomMessage, {
    2. required int messageWidth,
    })?,
  9. Widget customStatusBuilder(
    1. Message message, {
    2. required BuildContext context,
    })?,
  10. DateFormat? dateFormat,
  11. Widget dateHeaderBuilder(
    1. DateHeader
    )?,
  12. int dateHeaderThreshold = 900000,
  13. bool dateIsUtc = false,
  14. String? dateLocale,
  15. bool? disableImageGallery,
  16. EmojiEnlargementBehavior emojiEnlargementBehavior = EmojiEnlargementBehavior.multi,
  17. Widget? emptyState,
  18. Widget fileMessageBuilder(
    1. FileMessage, {
    2. required int messageWidth,
    })?,
  19. int groupMessagesThreshold = 60000,
  20. bool hideBackgroundOnEmojiMessages = true,
  21. ImageGalleryOptions imageGalleryOptions = const ImageGalleryOptions(maxScale: PhotoViewComputedScale.covered, minScale: PhotoViewComputedScale.contained),
  22. Map<String, String>? imageHeaders,
  23. Widget imageMessageBuilder(
    1. ImageMessage, {
    2. required int messageWidth,
    })?,
  24. ImageProvider<Object> imageProviderBuilder({
    1. required Conditional conditional,
    2. required Map<String, String>? imageHeaders,
    3. required String uri,
    })?,
  25. InputOptions inputOptions = const InputOptions(),
  26. bool? isAttachmentUploading,
  27. bool? isLastPage,
  28. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  29. ChatL10n l10n = const ChatL10nEn(),
  30. Widget? listBottomWidget,
  31. required List<Message> messages,
  32. Widget nameBuilder(
    1. User
    )?,
  33. VoidCallback? onAttachmentPressed,
  34. void onAvatarTap(
    1. User
    )?,
  35. VoidCallback? onBackgroundTap,
  36. Future<void> onEndReached()?,
  37. double? onEndReachedThreshold,
  38. void onMessageDoubleTap(
    1. BuildContext context,
    2. Message
    )?,
  39. void onMessageLongPress(
    1. BuildContext context,
    2. Message
    )?,
  40. void onMessageStatusLongPress(
    1. BuildContext context,
    2. Message
    )?,
  41. void onMessageStatusTap(
    1. BuildContext context,
    2. Message
    )?,
  42. void onMessageTap(
    1. BuildContext context,
    2. Message
    )?,
  43. void onMessageVisibilityChanged(
    1. Message,
    2. bool visible
    )?,
  44. void onPreviewDataFetched(
    1. TextMessage,
    2. PreviewData
    )?,
  45. required void onSendPressed(
    1. PartialText
    ),
  46. AutoScrollController? scrollController,
  47. ScrollPhysics? scrollPhysics,
  48. ScrollToUnreadOptions scrollToUnreadOptions = const ScrollToUnreadOptions(),
  49. bool showUserAvatars = false,
  50. bool showUserNames = false,
  51. Widget systemMessageBuilder(
    1. SystemMessage
    )?,
  52. Widget textMessageBuilder(
    1. TextMessage, {
    2. required int messageWidth,
    3. required bool showName,
    })?,
  53. TextMessageOptions textMessageOptions = const TextMessageOptions(),
  54. ChatTheme theme = const DefaultChatTheme(),
  55. DateFormat? timeFormat,
  56. TypingIndicatorOptions typingIndicatorOptions = const TypingIndicatorOptions(),
  57. bool usePreviewData = true,
  58. required User user,
  59. String? userAgent,
  60. bool? useTopSafeAreaInset,
  61. Widget videoMessageBuilder(
    1. VideoMessage, {
    2. required int messageWidth,
    })?,
})

Creates a chat widget.

Implementation

const Chat({
  super.key,
  this.audioMessageBuilder,
  this.avatarBuilder,
  this.bubbleBuilder,
  this.bubbleRtlAlignment = BubbleRtlAlignment.right,
  this.customBottomWidget,
  this.customDateHeaderText,
  this.customMessageBuilder,
  this.customStatusBuilder,
  this.dateFormat,
  this.dateHeaderBuilder,
  this.dateHeaderThreshold = 900000,
  this.dateIsUtc = false,
  this.dateLocale,
  this.disableImageGallery,
  this.emojiEnlargementBehavior = EmojiEnlargementBehavior.multi,
  this.emptyState,
  this.fileMessageBuilder,
  this.groupMessagesThreshold = 60000,
  this.hideBackgroundOnEmojiMessages = true,
  this.imageGalleryOptions = const ImageGalleryOptions(
    maxScale: PhotoViewComputedScale.covered,
    minScale: PhotoViewComputedScale.contained,
  ),
  this.imageHeaders,
  this.imageMessageBuilder,
  this.imageProviderBuilder,
  this.inputOptions = const InputOptions(),
  this.isAttachmentUploading,
  this.isLastPage,
  this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  this.l10n = const ChatL10nEn(),
  this.listBottomWidget,
  required this.messages,
  this.nameBuilder,
  this.onAttachmentPressed,
  this.onAvatarTap,
  this.onBackgroundTap,
  this.onEndReached,
  this.onEndReachedThreshold,
  this.onMessageDoubleTap,
  this.onMessageLongPress,
  this.onMessageStatusLongPress,
  this.onMessageStatusTap,
  this.onMessageTap,
  this.onMessageVisibilityChanged,
  this.onPreviewDataFetched,
  required this.onSendPressed,
  this.scrollController,
  this.scrollPhysics,
  this.scrollToUnreadOptions = const ScrollToUnreadOptions(),
  this.showUserAvatars = false,
  this.showUserNames = false,
  this.systemMessageBuilder,
  this.textMessageBuilder,
  this.textMessageOptions = const TextMessageOptions(),
  this.theme = const DefaultChatTheme(),
  this.timeFormat,
  this.typingIndicatorOptions = const TypingIndicatorOptions(),
  this.usePreviewData = true,
  required this.user,
  this.userAgent,
  this.useTopSafeAreaInset,
  this.videoMessageBuilder,
});