File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
packages/stream_chat_flutter/lib/src/message_widget Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class MessageCard extends StatefulWidget {
2929 required this .attachmentActionsModalBuilder,
3030 required this .textPadding,
3131 required this .reverse,
32+ required this .showFailedIndicator,
3233 this .shape,
3334 this .borderSide,
3435 this .borderRadiusGeometry,
@@ -120,6 +121,9 @@ class MessageCard extends StatefulWidget {
120121 /// {@macro reverse}
121122 final bool reverse;
122123
124+ /// {@macro showFailedIndicator}
125+ final bool showFailedIndicator;
126+
123127 @override
124128 State <MessageCard > createState () => _MessageCardState ();
125129}
@@ -165,8 +169,9 @@ class _MessageCardState extends State<MessageCard> {
165169 return Container (
166170 constraints: const BoxConstraints ().copyWith (maxWidth: widthLimit),
167171 margin: EdgeInsets .symmetric (
168- horizontal: (widget.isFailedState ? 15.0 : 0.0 ) +
169- (widget.showUserAvatar == DisplayWidget .gone ? 0 : 4.0 ),
172+ horizontal:
173+ (widget.isFailedState && widget.showFailedIndicator ? 15.0 : 0.0 ) +
174+ (widget.showUserAvatar == DisplayWidget .gone ? 0 : 4.0 ),
170175 ),
171176 clipBehavior: Clip .hardEdge,
172177 decoration: ShapeDecoration (
Original file line number Diff line number Diff line change @@ -451,6 +451,7 @@ class StreamMessageWidget extends StatefulWidget {
451451 String ? imageAttachmentThumbnailResizeType,
452452 String ? imageAttachmentThumbnailCropType,
453453 AttachmentActionsBuilder ? attachmentActionsModalBuilder,
454+ bool ? showFailedIndicator
454455 }) {
455456 return StreamMessageWidget (
456457 key: key ?? this .key,
@@ -520,6 +521,7 @@ class StreamMessageWidget extends StatefulWidget {
520521 this .imageAttachmentThumbnailCropType,
521522 attachmentActionsModalBuilder:
522523 attachmentActionsModalBuilder ?? this .attachmentActionsModalBuilder,
524+ showFailedIndicator: showFailedIndicator ?? this .showFailedIndicator,
523525 );
524526 }
525527
Original file line number Diff line number Diff line change @@ -336,6 +336,8 @@ class MessageWidgetContent extends StatelessWidget {
336336 : MessageCard (
337337 message: message,
338338 isFailedState: isFailedState,
339+ showFailedIndicator:
340+ showFailedIndicator,
339341 showUserAvatar: showUserAvatar,
340342 messageTheme: messageTheme,
341343 hasQuotedMessage: hasQuotedMessage,
You can’t perform that action at this time.
0 commit comments