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 {
28
28
required this .attachmentActionsModalBuilder,
29
29
required this .textPadding,
30
30
required this .reverse,
31
+ required this .showFailedIndicator,
31
32
this .shape,
32
33
this .borderSide,
33
34
this .borderRadiusGeometry,
@@ -116,6 +117,9 @@ class MessageCard extends StatefulWidget {
116
117
/// {@macro reverse}
117
118
final bool reverse;
118
119
120
+ /// {@macro showFailedIndicator}
121
+ final bool showFailedIndicator;
122
+
119
123
@override
120
124
State <MessageCard > createState () => _MessageCardState ();
121
125
}
@@ -161,8 +165,9 @@ class _MessageCardState extends State<MessageCard> {
161
165
return Container (
162
166
constraints: const BoxConstraints ().copyWith (maxWidth: widthLimit),
163
167
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 ),
166
171
),
167
172
clipBehavior: Clip .hardEdge,
168
173
decoration: ShapeDecoration (
Original file line number Diff line number Diff line change @@ -444,6 +444,7 @@ class StreamMessageWidget extends StatefulWidget {
444
444
String ? imageAttachmentThumbnailResizeType,
445
445
String ? imageAttachmentThumbnailCropType,
446
446
AttachmentActionsBuilder ? attachmentActionsModalBuilder,
447
+ bool ? showFailedIndicator
447
448
}) {
448
449
return StreamMessageWidget (
449
450
key: key ?? this .key,
@@ -512,6 +513,7 @@ class StreamMessageWidget extends StatefulWidget {
512
513
this .imageAttachmentThumbnailCropType,
513
514
attachmentActionsModalBuilder:
514
515
attachmentActionsModalBuilder ?? this .attachmentActionsModalBuilder,
516
+ showFailedIndicator: showFailedIndicator ?? this .showFailedIndicator,
515
517
);
516
518
}
517
519
Original file line number Diff line number Diff line change @@ -324,6 +324,8 @@ class MessageWidgetContent extends StatelessWidget {
324
324
: MessageCard (
325
325
message: message,
326
326
isFailedState: isFailedState,
327
+ showFailedIndicator:
328
+ showFailedIndicator,
327
329
showUserAvatar: showUserAvatar,
328
330
messageTheme: messageTheme,
329
331
hasQuotedMessage: hasQuotedMessage,
You can’t perform that action at this time.
0 commit comments