@@ -172,7 +172,7 @@ class MessageActionsModal extends StatelessWidget {
|
|||||||
_buildReplyButton(context),
|
_buildReplyButton(context),
|
||||||
if (showThreadReply &&
|
if (showThreadReply &&
|
||||||
(message.status ==
|
(message.status ==
|
||||||
MessageSendingStatus.SENT ||
|
MessageSendingStatus.SENT ||
|
||||||
message.status == null) &&
|
message.status == null) &&
|
||||||
message.parentId == null)
|
message.parentId == null)
|
||||||
_buildThreadReplyButton(context),
|
_buildThreadReplyButton(context),
|
||||||
|
|||||||
+99
-94
@@ -338,90 +338,94 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
: 0,
|
: 0,
|
||||||
)
|
)
|
||||||
: EdgeInsets.zero,
|
: EdgeInsets.zero,
|
||||||
child: (widget.message.isDeleted &&
|
child:
|
||||||
!isFailedState)
|
(widget.message.isDeleted &&
|
||||||
? Transform(
|
!isFailedState)
|
||||||
alignment: Alignment.center,
|
? Transform(
|
||||||
transform: Matrix4.rotationY(
|
alignment: Alignment.center,
|
||||||
widget.reverse ? pi : 0),
|
transform: Matrix4.rotationY(
|
||||||
child: DeletedMessage(
|
widget.reverse ? pi : 0),
|
||||||
reverse: widget.reverse,
|
child: DeletedMessage(
|
||||||
borderRadiusGeometry:
|
reverse: widget.reverse,
|
||||||
widget.borderRadiusGeometry,
|
borderRadiusGeometry: widget
|
||||||
borderSide: widget.borderSide,
|
.borderRadiusGeometry,
|
||||||
shape: widget.shape,
|
borderSide:
|
||||||
messageTheme:
|
widget.borderSide,
|
||||||
widget.messageTheme,
|
shape: widget.shape,
|
||||||
),
|
messageTheme:
|
||||||
)
|
widget.messageTheme,
|
||||||
: GestureDetector(
|
),
|
||||||
onLongPress: () =>
|
)
|
||||||
onLongPress(context),
|
: GestureDetector(
|
||||||
child: Material(
|
onLongPress: () =>
|
||||||
clipBehavior: Clip.antiAlias,
|
onLongPress(context),
|
||||||
shape: widget.shape ??
|
child: Material(
|
||||||
RoundedRectangleBorder(
|
clipBehavior:
|
||||||
side: isOnlyEmoji
|
Clip.antiAlias,
|
||||||
? BorderSide.none
|
shape: widget.shape ??
|
||||||
: widget.borderSide ??
|
RoundedRectangleBorder(
|
||||||
BorderSide(
|
side: isOnlyEmoji
|
||||||
color: Theme.of(context)
|
? BorderSide.none
|
||||||
.brightness ==
|
: widget.borderSide ??
|
||||||
Brightness
|
BorderSide(
|
||||||
.dark
|
color: Theme.of(context).brightness ==
|
||||||
|
Brightness
|
||||||
|
.dark
|
||||||
|
? StreamChatTheme.of(context)
|
||||||
|
.colorTheme
|
||||||
|
.white
|
||||||
|
.withAlpha(
|
||||||
|
24)
|
||||||
|
: StreamChatTheme.of(context)
|
||||||
|
.colorTheme
|
||||||
|
.black
|
||||||
|
.withAlpha(24),
|
||||||
|
),
|
||||||
|
borderRadius: widget
|
||||||
|
.borderRadiusGeometry ??
|
||||||
|
BorderRadius.zero,
|
||||||
|
),
|
||||||
|
color:
|
||||||
|
_getBackgroundColor(),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(
|
||||||
|
hasFiles ? 2.0 : 0.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
mainAxisSize:
|
||||||
|
MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
if (_hasReplyToMessage)
|
||||||
|
ReplyToMessageWidget(
|
||||||
|
message: widget
|
||||||
|
.message
|
||||||
|
.replyToMessage,
|
||||||
|
messageTheme: isMyMessage
|
||||||
? StreamChatTheme.of(
|
? StreamChatTheme.of(
|
||||||
context)
|
context)
|
||||||
.colorTheme
|
.otherMessageTheme
|
||||||
.white
|
|
||||||
.withAlpha(
|
|
||||||
24)
|
|
||||||
: StreamChatTheme.of(
|
: StreamChatTheme.of(
|
||||||
context)
|
context)
|
||||||
.colorTheme
|
.ownMessageTheme,
|
||||||
.black
|
reverse: widget
|
||||||
.withAlpha(
|
.reverse,
|
||||||
24),
|
|
||||||
),
|
),
|
||||||
borderRadius: widget
|
..._parseAttachments(
|
||||||
.borderRadiusGeometry ??
|
context),
|
||||||
BorderRadius.zero,
|
if (widget
|
||||||
),
|
.message.text
|
||||||
color: _getBackgroundColor(),
|
.trim()
|
||||||
child: Padding(
|
.isNotEmpty &&
|
||||||
padding: EdgeInsets.all(
|
!isGiphy)
|
||||||
hasFiles ? 2.0 : 0.0),
|
_buildTextBubble(
|
||||||
child: Column(
|
context),
|
||||||
crossAxisAlignment:
|
],
|
||||||
CrossAxisAlignment.start,
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
if (_hasReplyToMessage)
|
|
||||||
ReplyToMessageWidget(
|
|
||||||
message: widget
|
|
||||||
.message
|
|
||||||
.replyToMessage,
|
|
||||||
messageTheme: isMyMessage
|
|
||||||
? StreamChatTheme.of(
|
|
||||||
context)
|
|
||||||
.otherMessageTheme
|
|
||||||
: StreamChatTheme.of(
|
|
||||||
context)
|
|
||||||
.ownMessageTheme,
|
|
||||||
reverse: widget
|
|
||||||
.reverse,
|
|
||||||
),
|
),
|
||||||
..._parseAttachments(
|
),
|
||||||
context),
|
),
|
||||||
if (widget.message.text
|
|
||||||
.trim()
|
|
||||||
.isNotEmpty &&
|
|
||||||
!isGiphy)
|
|
||||||
_buildTextBubble(context),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),),
|
|
||||||
),
|
),
|
||||||
if (widget.showReactionPickerIndicator)
|
if (widget.showReactionPickerIndicator)
|
||||||
Positioned(
|
Positioned(
|
||||||
@@ -692,9 +696,10 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
onReplyTap: widget.onReplyTap,
|
onReplyTap: widget.onReplyTap,
|
||||||
onThreadReplyTap: widget.onThreadTap,
|
onThreadReplyTap: widget.onThreadTap,
|
||||||
showResendMessage:
|
showResendMessage:
|
||||||
widget.showResendMessage && (isSendFailed || isUpdateFailed),
|
widget.showResendMessage && (isSendFailed || isUpdateFailed),
|
||||||
showCopyMessage: !isFailedState &&
|
showCopyMessage: !isFailedState &&
|
||||||
widget.message.text?.trim()?.isNotEmpty == true, showEditMessage: widget.showEditMessage &&
|
widget.message.text?.trim()?.isNotEmpty == true,
|
||||||
|
showEditMessage: widget.showEditMessage &&
|
||||||
!isDeleteFailed &&
|
!isDeleteFailed &&
|
||||||
widget.message.attachments
|
widget.message.attachments
|
||||||
?.any((element) => element.type == 'giphy') !=
|
?.any((element) => element.type == 'giphy') !=
|
||||||
@@ -704,7 +709,7 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
!isFailedState &&
|
!isFailedState &&
|
||||||
widget.onReplyTap != null,
|
widget.onReplyTap != null,
|
||||||
showThreadReply:
|
showThreadReply:
|
||||||
widget.showThreadReplyIndicator && widget.onThreadTap != null,
|
widget.showThreadReplyIndicator && widget.onThreadTap != null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -807,22 +812,22 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
final attachmentShape =
|
final attachmentShape =
|
||||||
widget.attachmentShape ?? widget.shape ?? _getDefaultShape(context);
|
widget.attachmentShape ?? widget.shape ?? _getDefaultShape(context);
|
||||||
return Material(
|
return Material(
|
||||||
color: _getBackgroundColor(),
|
color: _getBackgroundColor(),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
shape: attachmentShape,
|
shape: attachmentShape,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: widget.attachmentPadding,
|
padding: widget.attachmentPadding,
|
||||||
child: Material(
|
child: Material(
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
shape: attachmentShape,
|
shape: attachmentShape,
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: Transform(
|
child: Transform(
|
||||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: attachmentWidget,
|
child: attachmentWidget,
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user