From 41450706dc971ee5be1e5a87bfedf8ccbd3b44a6 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Mon, 26 Oct 2020 16:21:35 +0530 Subject: [PATCH] fix: attachments ui --- lib/src/message_input.dart | 59 ++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 57ecc22a..c8457fdb 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -612,38 +612,41 @@ class MessageInputState extends State { } Widget _buildAttachments() { - return Wrap( - direction: Axis.horizontal, - children: _attachments - .map( - (attachment) => Padding( - padding: const EdgeInsets.all(8.0), - child: ClipRRect( - borderRadius: BorderRadius.circular(10), - child: Stack( - children: [ - Container( - height: 50, - width: 50, - child: _buildAttachment(attachment), - ), - _buildRemoveButton(attachment), - attachment.uploaded - ? SizedBox() - : Positioned.fill( - child: Center( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: CircularProgressIndicator(), + return Container( + height: 76.0, + child: ListView( + scrollDirection: Axis.horizontal, + children: _attachments + .map( + (attachment) => Padding( + padding: const EdgeInsets.all(8.0), + child: ClipRRect( + borderRadius: BorderRadius.circular(10), + child: Stack( + children: [ + Container( + height: 50, + width: 50, + child: _buildAttachment(attachment), + ), + _buildRemoveButton(attachment), + attachment.uploaded + ? SizedBox() + : Positioned.fill( + child: Center( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: CircularProgressIndicator(), + ), ), ), - ), - ], + ], + ), ), ), - ), - ) - .toList(), + ) + .toList(), + ), ); }