fix: attachment borders
This commit is contained in:
@@ -192,7 +192,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
attachmentBorderRadiusGeometry: widget
|
||||
.attachmentBorderRadiusGeometry
|
||||
?.mirrorBorderIfReversed(
|
||||
reverse: widget.reverse),
|
||||
reverse: !widget.reverse),
|
||||
message: widget.message.copyWith(
|
||||
text: widget.message.text!.length > 200
|
||||
// ignore: lines_longer_than_80_chars
|
||||
|
||||
@@ -980,14 +980,23 @@ class _MessageListViewState extends State<MessageListView> {
|
||||
onReplyTap: widget.onReplyTap,
|
||||
attachmentBorderRadiusGeometry: BorderRadius.only(
|
||||
topLeft: Radius.circular(attachmentBorderRadius),
|
||||
bottomLeft: Radius.circular(
|
||||
(timeDiff >= 1 || !isNextUserSame) &&
|
||||
!(hasReplies || isThreadMessage || hasFileAttachment)
|
||||
? 0
|
||||
: attachmentBorderRadius,
|
||||
),
|
||||
bottomLeft: isMyMessage
|
||||
? Radius.circular(attachmentBorderRadius)
|
||||
: Radius.circular(
|
||||
(timeDiff >= 1 || !isNextUserSame) &&
|
||||
!(hasReplies || isThreadMessage || hasFileAttachment)
|
||||
? 0
|
||||
: attachmentBorderRadius,
|
||||
),
|
||||
topRight: Radius.circular(attachmentBorderRadius),
|
||||
bottomRight: Radius.circular(attachmentBorderRadius),
|
||||
bottomRight: isMyMessage
|
||||
? Radius.circular(
|
||||
(timeDiff >= 1 || !isNextUserSame) &&
|
||||
!(hasReplies || isThreadMessage || hasFileAttachment)
|
||||
? 0
|
||||
: attachmentBorderRadius,
|
||||
)
|
||||
: Radius.circular(attachmentBorderRadius),
|
||||
),
|
||||
attachmentPadding: EdgeInsets.all(hasFileAttachment ? 4 : 2),
|
||||
borderRadiusGeometry: BorderRadius.only(
|
||||
|
||||
@@ -146,7 +146,7 @@ class MessageReactionsModal extends StatelessWidget {
|
||||
attachmentBorderRadiusGeometry:
|
||||
attachmentBorderRadiusGeometry
|
||||
?.mirrorBorderIfReversed(
|
||||
reverse: reverse),
|
||||
reverse: !reverse),
|
||||
attachmentPadding: EdgeInsets.all(
|
||||
hasFileAttachment ? 4 : 2,
|
||||
),
|
||||
|
||||
@@ -131,8 +131,6 @@ class MessageWidget extends StatefulWidget {
|
||||
),
|
||||
border,
|
||||
reverse,
|
||||
attachmentBorderRadiusGeometry as BorderRadius? ??
|
||||
BorderRadius.zero,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -157,8 +155,6 @@ class MessageWidget extends StatefulWidget {
|
||||
),
|
||||
border,
|
||||
reverse,
|
||||
attachmentBorderRadiusGeometry as BorderRadius? ??
|
||||
BorderRadius.zero,
|
||||
);
|
||||
},
|
||||
'video': (context, message, attachments) {
|
||||
@@ -191,8 +187,6 @@ class MessageWidget extends StatefulWidget {
|
||||
),
|
||||
border,
|
||||
reverse,
|
||||
attachmentBorderRadiusGeometry as BorderRadius? ??
|
||||
BorderRadius.zero,
|
||||
);
|
||||
},
|
||||
'giphy': (context, message, attachments) {
|
||||
@@ -219,8 +213,6 @@ class MessageWidget extends StatefulWidget {
|
||||
),
|
||||
border,
|
||||
reverse,
|
||||
attachmentBorderRadiusGeometry as BorderRadius? ??
|
||||
BorderRadius.zero,
|
||||
);
|
||||
},
|
||||
'file': (context, message, attachments) {
|
||||
@@ -248,8 +240,6 @@ class MessageWidget extends StatefulWidget {
|
||||
),
|
||||
border,
|
||||
reverse,
|
||||
attachmentBorderRadiusGeometry as BorderRadius? ??
|
||||
BorderRadius.zero,
|
||||
);
|
||||
})
|
||||
.insertBetween(SizedBox(
|
||||
|
||||
@@ -331,14 +331,10 @@ Widget wrapAttachmentWidget(
|
||||
ShapeBorder attachmentShape,
|
||||
// ignore: avoid_positional_boolean_parameters
|
||||
bool reverse,
|
||||
BorderRadius borderRadius,
|
||||
) =>
|
||||
ClipRRect(
|
||||
borderRadius: borderRadius.mirrorBorderIfReversed(reverse: reverse),
|
||||
child: Material(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
shape: attachmentShape,
|
||||
type: MaterialType.transparency,
|
||||
child: attachmentWidget,
|
||||
),
|
||||
Material(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
shape: attachmentShape,
|
||||
type: MaterialType.transparency,
|
||||
child: attachmentWidget,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user