Merge branch 'master' into feature/notifications

This commit is contained in:
Salvatore Giordano
2020-04-22 10:53:41 +02:00
6 changed files with 210 additions and 107 deletions
+16 -1
View File
@@ -214,7 +214,7 @@ class _MessageWidgetState extends State<MessageWidget>
var nOfAttachmentWidgets = 0;
final column =
List<Widget>.from(widget.message.attachments?.map((attachment) {
List<Widget>.from(widget.message.attachments.map((attachment) {
nOfAttachmentWidgets++;
Widget attachmentWidget;
@@ -223,6 +223,21 @@ class _MessageWidgetState extends State<MessageWidget>
} 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) {