fix reaction ui for messages with attachment

This commit is contained in:
Salvatore Giordano
2020-02-26 17:14:08 +01:00
parent d4632dc8ef
commit b502fafa13
+20 -7
View File
@@ -227,10 +227,17 @@ class _MessageWidgetState extends State<MessageWidget>
widget.message.reactionCounts?.isNotEmpty == true ? 2.0 : 0.0; widget.message.reactionCounts?.isNotEmpty == true ? 2.0 : 0.0;
column.children.addAll( column.children.addAll(
<Widget>[ <Widget>[
IntrinsicWidth(
child: Column(
crossAxisAlignment: isMyMessage
? CrossAxisAlignment.end
: CrossAxisAlignment.start,
children: <Widget>[
Align( Align(
child: _buildReactions(isMyMessage), child: _buildReactions(isMyMessage),
alignment: alignment: isMyMessage
isMyMessage ? Alignment.centerLeft : Alignment.centerRight, ? Alignment.centerLeft
: Alignment.centerRight,
), ),
Stack( Stack(
overflow: Overflow.visible, overflow: Overflow.visible,
@@ -253,10 +260,12 @@ class _MessageWidgetState extends State<MessageWidget>
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: nOfAttachmentWidgets > 0 ? (topPadding) : (topPadding), top: nOfAttachmentWidgets > 0
? (topPadding)
: (topPadding),
), ),
decoration: _buildBoxDecoration( decoration: _buildBoxDecoration(isMyMessage,
isMyMessage, isLastUser || nOfAttachmentWidgets > 0), isLastUser || nOfAttachmentWidgets > 0),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
constraints: BoxConstraints.loose(Size.fromWidth(300)), constraints: BoxConstraints.loose(Size.fromWidth(300)),
child: MarkdownBody( child: MarkdownBody(
@@ -264,18 +273,22 @@ class _MessageWidgetState extends State<MessageWidget>
onTapLink: (link) { onTapLink: (link) {
_launchURL(link); _launchURL(link);
}, },
styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context)), styleSheet:
MarkdownStyleSheet.fromTheme(Theme.of(context)),
), ),
), ),
), ),
], ],
), ),
], ],
),
),
],
); );
} }
return GestureDetector( return GestureDetector(
child: IntrinsicWidth(child: column), child: column,
onLongPress: () { onLongPress: () {
_showMessageBottomSheet(context); _showMessageBottomSheet(context);
}); });