diff --git a/packages/stream_chat_flutter/lib/src/message_widget/message_card.dart b/packages/stream_chat_flutter/lib/src/message_widget/message_card.dart index 0c981ad79..0fe2eeba2 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/message_card.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/message_card.dart @@ -28,6 +28,7 @@ class MessageCard extends StatefulWidget { required this.attachmentActionsModalBuilder, required this.textPadding, required this.reverse, + required this.showFailedIndicator, this.shape, this.borderSide, this.borderRadiusGeometry, @@ -116,6 +117,9 @@ class MessageCard extends StatefulWidget { /// {@macro reverse} final bool reverse; + /// {@macro showFailedIndicator} + final bool showFailedIndicator; + @override State createState() => _MessageCardState(); } @@ -161,8 +165,9 @@ class _MessageCardState extends State { return Container( constraints: const BoxConstraints().copyWith(maxWidth: widthLimit), margin: EdgeInsets.symmetric( - horizontal: (widget.isFailedState ? 15.0 : 0.0) + - (widget.showUserAvatar == DisplayWidget.gone ? 0 : 4.0), + horizontal: + (widget.isFailedState && widget.showFailedIndicator ? 15.0 : 0.0) + + (widget.showUserAvatar == DisplayWidget.gone ? 0 : 4.0), ), clipBehavior: Clip.hardEdge, decoration: ShapeDecoration( diff --git a/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart b/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart index 0deeac11d..79bea79cc 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart @@ -444,6 +444,7 @@ class StreamMessageWidget extends StatefulWidget { String? imageAttachmentThumbnailResizeType, String? imageAttachmentThumbnailCropType, AttachmentActionsBuilder? attachmentActionsModalBuilder, + bool? showFailedIndicator }) { return StreamMessageWidget( key: key ?? this.key, @@ -512,6 +513,7 @@ class StreamMessageWidget extends StatefulWidget { this.imageAttachmentThumbnailCropType, attachmentActionsModalBuilder: attachmentActionsModalBuilder ?? this.attachmentActionsModalBuilder, + showFailedIndicator: showFailedIndicator ?? this.showFailedIndicator, ); } diff --git a/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart b/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart index 47fd1fbc6..093938f51 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart @@ -324,6 +324,8 @@ class MessageWidgetContent extends StatelessWidget { : MessageCard( message: message, isFailedState: isFailedState, + showFailedIndicator: + showFailedIndicator, showUserAvatar: showUserAvatar, messageTheme: messageTheme, hasQuotedMessage: hasQuotedMessage,