[Message Widget] fix error icon stack position

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2020-12-31 15:59:51 +05:30
parent dde32437c8
commit ab6a741183
+21 -24
View File
@@ -243,6 +243,12 @@ class _MessageWidgetState extends State<MessageWidget> {
bool get isFailedState => isSendFailed || isUpdateFailed || isDeleteFailed; bool get isFailedState => isSendFailed || isUpdateFailed || isDeleteFailed;
bool get showBottomRow =>
showThreadReplyIndicator ||
showUsername ||
showTimeStamp ||
showInChannel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var leftPadding = widget.showUserAvatar != DisplayWidget.gone var leftPadding = widget.showUserAvatar != DisplayWidget.gone
@@ -267,6 +273,7 @@ class _MessageWidgetState extends State<MessageWidget> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Stack( Stack(
clipBehavior: Clip.none,
alignment: AlignmentDirectional.bottomStart, alignment: AlignmentDirectional.bottomStart,
children: [ children: [
Column( Column(
@@ -389,39 +396,29 @@ class _MessageWidgetState extends State<MessageWidget> {
), ),
), ),
), ),
],
),
),
),
],
),
if (showBottomRow) SizedBox(height: 20.0),
],
),
if (showBottomRow) _buildBottomRow(leftPadding),
if (isFailedState) if (isFailedState)
Positioned( Positioned(
left: widget.reverse ? -6 : null, left: widget.reverse ? -3 : null,
right: widget.reverse ? null : -6, right: widget.reverse ? null : -9,
bottom: 0, bottom: showBottomRow ? 20 : 0,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: StreamSvgIcon.error( child: StreamSvgIcon.error(size: 20),
size: 20,
), ),
), ),
),
],
),
),
),
],
),
if (showThreadReplyIndicator ||
showUsername ||
showTimeStamp ||
showInChannel)
SizedBox(height: 20.0),
],
),
if (showThreadReplyIndicator ||
showUsername ||
showTimeStamp ||
showInChannel)
_buildBottomRow(leftPadding)
], ],
), ),
], ],