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 @@ -28,6 +28,7 @@ class MessageCard extends StatefulWidget {
2828 required this .attachmentActionsModalBuilder,
2929 required this .textPadding,
3030 required this .reverse,
31+ required this .showFailedIndicator,
3132 this .shape,
3233 this .borderSide,
3334 this .borderRadiusGeometry,
@@ -116,6 +117,9 @@ class MessageCard extends StatefulWidget {
116117 /// {@macro reverse}
117118 final bool reverse;
118119
120+ /// {@macro showFailedIndicator}
121+ final bool showFailedIndicator;
122+
119123 @override
120124 State <MessageCard > createState () => _MessageCardState ();
121125}
@@ -161,8 +165,9 @@ class _MessageCardState extends State<MessageCard> {
161165 return Container (
162166 constraints: const BoxConstraints ().copyWith (maxWidth: widthLimit),
163167 margin: EdgeInsets .symmetric (
164- horizontal: (widget.isFailedState ? 15.0 : 0.0 ) +
165- (widget.showUserAvatar == DisplayWidget .gone ? 0 : 4.0 ),
168+ horizontal:
169+ (widget.isFailedState && widget.showFailedIndicator ? 15.0 : 0.0 ) +
170+ (widget.showUserAvatar == DisplayWidget .gone ? 0 : 4.0 ),
166171 ),
167172 clipBehavior: Clip .hardEdge,
168173 decoration: ShapeDecoration (
Original file line number Diff line number Diff line change @@ -444,6 +444,7 @@ class StreamMessageWidget extends StatefulWidget {
444444 String ? imageAttachmentThumbnailResizeType,
445445 String ? imageAttachmentThumbnailCropType,
446446 AttachmentActionsBuilder ? attachmentActionsModalBuilder,
447+ bool ? showFailedIndicator
447448 }) {
448449 return StreamMessageWidget (
449450 key: key ?? this .key,
@@ -512,6 +513,7 @@ class StreamMessageWidget extends StatefulWidget {
512513 this .imageAttachmentThumbnailCropType,
513514 attachmentActionsModalBuilder:
514515 attachmentActionsModalBuilder ?? this .attachmentActionsModalBuilder,
516+ showFailedIndicator: showFailedIndicator ?? this .showFailedIndicator,
515517 );
516518 }
517519
Original file line number Diff line number Diff line change @@ -324,6 +324,8 @@ class MessageWidgetContent extends StatelessWidget {
324324 : MessageCard (
325325 message: message,
326326 isFailedState: isFailedState,
327+ showFailedIndicator:
328+ showFailedIndicator,
327329 showUserAvatar: showUserAvatar,
328330 messageTheme: messageTheme,
329331 hasQuotedMessage: hasQuotedMessage,
You can’t perform that action at this time.
0 commit comments