From 8dff93c641a3b690f4d2dcc32edcbabbef53b78f Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Mon, 26 Oct 2020 16:37:43 +0530 Subject: [PATCH] fix: attachments ui --- lib/src/message_input.dart | 47 ++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 9cd4617b..65d55d6f 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -618,34 +618,37 @@ class MessageInputState extends State { return _attachments.isEmpty ? Container() : LimitedBox( - maxHeight: 80.0, + maxHeight: 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(), + (attachment) => AspectRatio( + aspectRatio: 1.0, + child: 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(), + ), ), ), - ), - ], + ], + ), ), ), ),