fix: attachments ui

This commit is contained in:
Deven Joshi
2020-10-26 16:37:43 +05:30
parent f3a9b0939f
commit 8dff93c641
+25 -22
View File
@@ -618,34 +618,37 @@ class MessageInputState extends State<MessageInput> {
return _attachments.isEmpty return _attachments.isEmpty
? Container() ? Container()
: LimitedBox( : LimitedBox(
maxHeight: 80.0, maxHeight: 76.0,
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: _attachments children: _attachments
.map( .map(
(attachment) => Padding( (attachment) => AspectRatio(
padding: const EdgeInsets.all(8.0), aspectRatio: 1.0,
child: ClipRRect( child: Padding(
borderRadius: BorderRadius.circular(10), padding: const EdgeInsets.all(8.0),
child: Stack( child: ClipRRect(
children: <Widget>[ borderRadius: BorderRadius.circular(10),
Container( child: Stack(
height: 50, children: <Widget>[
width: 50, Container(
child: _buildAttachment(attachment), height: 50,
), width: 50,
_buildRemoveButton(attachment), child: _buildAttachment(attachment),
attachment.uploaded ),
? SizedBox() _buildRemoveButton(attachment),
: Positioned.fill( attachment.uploaded
child: Center( ? SizedBox()
child: Padding( : Positioned.fill(
padding: const EdgeInsets.all(16.0), child: Center(
child: CircularProgressIndicator(), child: Padding(
padding: const EdgeInsets.all(16.0),
child: CircularProgressIndicator(),
),
), ),
), ),
), ],
], ),
), ),
), ),
), ),