Skip to content

Commit

Permalink
Merge pull request #27 from ardriveapp/fix-fromxfile-method
Browse files Browse the repository at this point in the history
fix(IOFile)
  • Loading branch information
thiagocarvalhodev authored Nov 18, 2024
2 parents 87e9e3a + 0771a17 commit 07983a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/src/io_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ class IOFileAdapter {

Future<IOFile> fromXFile(XFile file) async {
final lastModified = await file.lastModified();
final contentType =
file.mimeType ?? lookupMimeTypeWithDefaultType(file.path);
String contentType;

if (file.mimeType != null && file.mimeType!.isNotEmpty) {
contentType = file.mimeType!;
} else {
contentType = lookupMimeTypeWithDefaultType(file.path);
}

return _FromXFile(
file,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ardrive_io
description: A new Flutter package project.
version: 1.4.6
version: 1.4.7
homepage:
publish_to: none

Expand Down

0 comments on commit 07983a8

Please sign in to comment.