fix reaction ui for messages with attachment
This commit is contained in:
+54
-41
@@ -227,55 +227,68 @@ 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>[
|
||||||
Align(
|
IntrinsicWidth(
|
||||||
child: _buildReactions(isMyMessage),
|
child: Column(
|
||||||
alignment:
|
crossAxisAlignment: isMyMessage
|
||||||
isMyMessage ? Alignment.centerLeft : Alignment.centerRight,
|
? CrossAxisAlignment.end
|
||||||
),
|
: CrossAxisAlignment.start,
|
||||||
Stack(
|
children: <Widget>[
|
||||||
overflow: Overflow.visible,
|
Align(
|
||||||
children: <Widget>[
|
child: _buildReactions(isMyMessage),
|
||||||
widget.message.reactionCounts?.isNotEmpty == true
|
alignment: isMyMessage
|
||||||
? Positioned(
|
? Alignment.centerLeft
|
||||||
left: isMyMessage ? 8 : null,
|
: Alignment.centerRight,
|
||||||
right: !isMyMessage ? 8 : null,
|
),
|
||||||
top: -4,
|
Stack(
|
||||||
child: CustomPaint(
|
overflow: Overflow.visible,
|
||||||
painter: ReactionBubblePainter(),
|
children: <Widget>[
|
||||||
|
widget.message.reactionCounts?.isNotEmpty == true
|
||||||
|
? Positioned(
|
||||||
|
left: isMyMessage ? 8 : null,
|
||||||
|
right: !isMyMessage ? 8 : null,
|
||||||
|
top: -4,
|
||||||
|
child: CustomPaint(
|
||||||
|
painter: ReactionBubblePainter(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: SizedBox(),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
right: isMyMessage ? 0.0 : 8.0,
|
||||||
|
left: isMyMessage ? 8.0 : 0.0,
|
||||||
),
|
),
|
||||||
)
|
child: AnimatedContainer(
|
||||||
: SizedBox(),
|
duration: Duration(milliseconds: 300),
|
||||||
Padding(
|
margin: EdgeInsets.only(
|
||||||
padding: EdgeInsets.only(
|
top: nOfAttachmentWidgets > 0
|
||||||
right: isMyMessage ? 0.0 : 8.0,
|
? (topPadding)
|
||||||
left: isMyMessage ? 8.0 : 0.0,
|
: (topPadding),
|
||||||
|
),
|
||||||
|
decoration: _buildBoxDecoration(isMyMessage,
|
||||||
|
isLastUser || nOfAttachmentWidgets > 0),
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
constraints: BoxConstraints.loose(Size.fromWidth(300)),
|
||||||
|
child: MarkdownBody(
|
||||||
|
data: '${widget.message.text}',
|
||||||
|
onTapLink: (link) {
|
||||||
|
_launchURL(link);
|
||||||
|
},
|
||||||
|
styleSheet:
|
||||||
|
MarkdownStyleSheet.fromTheme(Theme.of(context)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: AnimatedContainer(
|
],
|
||||||
duration: Duration(milliseconds: 300),
|
),
|
||||||
margin: EdgeInsets.only(
|
|
||||||
top: nOfAttachmentWidgets > 0 ? (topPadding) : (topPadding),
|
|
||||||
),
|
|
||||||
decoration: _buildBoxDecoration(
|
|
||||||
isMyMessage, isLastUser || nOfAttachmentWidgets > 0),
|
|
||||||
padding: EdgeInsets.all(10),
|
|
||||||
constraints: BoxConstraints.loose(Size.fromWidth(300)),
|
|
||||||
child: MarkdownBody(
|
|
||||||
data: '${widget.message.text}',
|
|
||||||
onTapLink: (link) {
|
|
||||||
_launchURL(link);
|
|
||||||
},
|
|
||||||
styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: IntrinsicWidth(child: column),
|
child: column,
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
_showMessageBottomSheet(context);
|
_showMessageBottomSheet(context);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user