[MessageWidget] Move bottomRow padding to upper layer
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
+52
-52
@@ -449,7 +449,11 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
if (showBottomRow) SizedBox(height: 20.0),
|
if (showBottomRow) SizedBox(height: 20.0),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (showBottomRow) _buildBottomRow(leftPadding),
|
if (showBottomRow)
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: leftPadding),
|
||||||
|
child: _bottomRow,
|
||||||
|
),
|
||||||
if (isFailedState)
|
if (isFailedState)
|
||||||
Positioned(
|
Positioned(
|
||||||
left: widget.reverse ? -3 : null,
|
left: widget.reverse ? -3 : null,
|
||||||
@@ -492,28 +496,27 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBottomRow(double leftPadding) {
|
Widget get _bottomRow {
|
||||||
if (widget.message.isDeleted) {
|
if (widget.message.isDeleted) {
|
||||||
return Padding(
|
return Transform(
|
||||||
padding: EdgeInsets.only(left: leftPadding),
|
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
||||||
child: Transform(
|
alignment: Alignment.center,
|
||||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
child: Row(
|
||||||
alignment: Alignment.center,
|
mainAxisSize: MainAxisSize.min,
|
||||||
child: Row(
|
children: [
|
||||||
mainAxisSize: MainAxisSize.min,
|
StreamSvgIcon.eye(
|
||||||
children: [
|
color: StreamChatTheme.of(context).colorTheme.grey,
|
||||||
StreamSvgIcon.eye(
|
size: 16.0,
|
||||||
color: StreamChatTheme.of(context).colorTheme.grey,
|
),
|
||||||
size: 16.0,
|
SizedBox(width: 8.0),
|
||||||
),
|
Text(
|
||||||
SizedBox(width: 8.0),
|
'Only visible to you',
|
||||||
Text(
|
style: StreamChatTheme.of(context)
|
||||||
'Only visible to you',
|
.textTheme
|
||||||
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
|
.footnote
|
||||||
color: StreamChatTheme.of(context).colorTheme.grey),
|
.copyWith(color: StreamChatTheme.of(context).colorTheme.grey),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -573,40 +576,37 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
|
|
||||||
if (widget.reverse) children = children.reversed.toList();
|
if (widget.reverse) children = children.reversed.toList();
|
||||||
|
|
||||||
return Padding(
|
return Flex(
|
||||||
padding: EdgeInsets.only(left: leftPadding),
|
direction: Axis.horizontal,
|
||||||
child: Flex(
|
clipBehavior: Clip.none,
|
||||||
direction: Axis.horizontal,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
clipBehavior: Clip.none,
|
children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
if (showThreadReplyIndicator || showInChannel)
|
||||||
children: [
|
Container(
|
||||||
if (showThreadReplyIndicator || showInChannel)
|
margin: EdgeInsets.only(
|
||||||
Container(
|
bottom: widget.messageTheme.replies.fontSize / 2,
|
||||||
margin: EdgeInsets.only(
|
|
||||||
bottom: widget.messageTheme.replies.fontSize / 2,
|
|
||||||
),
|
|
||||||
child: CustomPaint(
|
|
||||||
size: const Size(16, 32),
|
|
||||||
painter: _ThreadReplyPainter(
|
|
||||||
context: context,
|
|
||||||
color: widget.messageTheme.messageBorderColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
...children.map(
|
child: CustomPaint(
|
||||||
(child) => Transform(
|
size: const Size(16, 32),
|
||||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
painter: _ThreadReplyPainter(
|
||||||
alignment: Alignment.center,
|
context: context,
|
||||||
child: Container(
|
color: widget.messageTheme.messageBorderColor,
|
||||||
height: 16,
|
|
||||||
child: Center(
|
|
||||||
child: child,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
].insertBetween(const SizedBox(width: 8.0)),
|
...children.map(
|
||||||
),
|
(child) => Transform(
|
||||||
|
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Container(
|
||||||
|
height: 16,
|
||||||
|
child: Center(
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].insertBetween(const SizedBox(width: 8.0)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user