fix: Fixed multiple file upload

This commit is contained in:
Deven Joshi
2020-12-03 11:39:38 +01:00
committed by Salvatore Giordano
parent 922208224d
commit a846048ef1
+29 -20
View File
@@ -1203,26 +1203,35 @@ class MessageInputState extends State<MessageInput> {
? Container() ? Container()
: Column( : Column(
children: [ children: [
..._attachments LimitedBox(
.where((e) => e.attachment.type == 'file') maxHeight: 73.0,
.map( child: ListView(
(e) => FileAttachment( scrollDirection: Axis.horizontal,
attachment: e.attachment, children: _attachments
size: Size( .where((e) => e.attachment.type == 'file')
MediaQuery.of(context).size.width * 0.6, .map(
MediaQuery.of(context).size.height * 0.3, (e) => Padding(
), padding: const EdgeInsets.symmetric(horizontal: 4.0),
trailing: IconButton( child: FileAttachment(
icon: StreamSvgIcon.close_small(), attachment: e.attachment,
onPressed: () { size: Size(
setState(() { MediaQuery.of(context).size.width * 0.55,
_attachments.remove(e); MediaQuery.of(context).size.height * 0.3,
}); ),
}, trailing: IconButton(
), icon: StreamSvgIcon.close_small(),
), onPressed: () {
) setState(() {
.toList(), _attachments.remove(e);
});
},
),
),
),
)
.toList(),
),
),
if (_attachments.any((e) => e.attachment.type != 'file')) if (_attachments.any((e) => e.attachment.type != 'file'))
LimitedBox( LimitedBox(
maxHeight: 104.0, maxHeight: 104.0,