add simple rendering of files

This commit is contained in:
Salvatore Giordano
2020-04-21 16:36:53 +02:00
parent 95b0c991a1
commit fee0eff11f
+15
View File
@@ -301,6 +301,21 @@ class _MessageWidgetState extends State<MessageWidget>
attachmentWidget = _buildVideo(attachment);
} else if (attachment.type == 'image' || attachment.type == 'giphy') {
attachmentWidget = _buildImage(attachment);
} else if (attachment.type == 'file') {
attachmentWidget = Material(
child: InkWell(
onTap: () {
_launchURL(attachment.assetUrl);
},
child: Container(
width: 100,
height: 100,
child: Center(
child: Icon(Icons.attach_file),
),
),
),
);
}
if (attachmentWidget != null) {