fix tutorial examples

This commit is contained in:
Salvatore Giordano
2021-01-22 15:24:19 +01:00
parent ce2db23ffb
commit 6035f177f9
8 changed files with 147 additions and 160 deletions
@@ -41,7 +41,7 @@ class _FileAttachmentState extends State<FileAttachment> {
@override
void initState() {
super.initState();
if (MediaUtils.getMimeType(widget.attachment.title).type == 'video') {
if (MediaUtils.getMimeType(widget.attachment.title)?.type == 'video') {
if (widget.attachmentType == FileAttachmentType.online) {
_controller = VideoPlayerController.network(
widget.attachment.assetUrl,
@@ -128,7 +128,7 @@ class _FileAttachmentState extends State<FileAttachment> {
}
Widget _getFileTypeImage() {
if ((MediaUtils.getMimeType(widget.attachment.title).type == 'image')) {
if ((MediaUtils.getMimeType(widget.attachment.title)?.type == 'image')) {
switch (widget.attachmentType) {
case FileAttachmentType.local:
return Image.memory(
@@ -165,7 +165,7 @@ class _FileAttachmentState extends State<FileAttachment> {
}
}
if ((MediaUtils.getMimeType(widget.attachment.title).type == 'video')) {
if ((MediaUtils.getMimeType(widget.attachment.title)?.type == 'video')) {
switch (widget.attachmentType) {
case FileAttachmentType.local:
return FutureBuilder<File>(