fix tutorial examples
This commit is contained in:
@@ -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>(
|
||||
|
||||
Reference in New Issue
Block a user