fix: attachments ui

This commit is contained in:
Deven Joshi
2020-10-26 16:21:35 +05:30
parent 0aba24d5a7
commit 41450706dc
+31 -28
View File
@@ -612,38 +612,41 @@ class MessageInputState extends State<MessageInput> {
} }
Widget _buildAttachments() { Widget _buildAttachments() {
return Wrap( return Container(
direction: Axis.horizontal, height: 76.0,
children: _attachments child: ListView(
.map( scrollDirection: Axis.horizontal,
(attachment) => Padding( children: _attachments
padding: const EdgeInsets.all(8.0), .map(
child: ClipRRect( (attachment) => 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(),
),
), ),
), ),
), ],
], ),
), ),
), ),
), )
) .toList(),
.toList(), ),
); );
} }