-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #856: picking .app files on macOS
.app files on macOS are actually directories. But, they are treated as files by the file picker and therefore can only be selected via 'FilePicker.platform.pickFiles()'. When picking .app files, 'createPlatformFile()' tries to get the size of the .app file which throws an exception because directories don't have an inherent size.
- Loading branch information
Showing
4 changed files
with
60 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
import 'dart:io'; | ||
|
||
setUpTestFiles( | ||
String imageTestFile, | ||
String pdfTestFile, | ||
String yamlTestFile, | ||
String appTestFilePath, | ||
String imageTestFilePath, | ||
String pdfTestFilePath, | ||
String yamlTestFilePath, | ||
) { | ||
// .app files on macOS are actually directories but they are treated as files | ||
Directory(appTestFilePath).createSync(); | ||
|
||
File( | ||
'./test/test_files/franz-michael-schneeberger-unsplash.jpg', | ||
).copySync(imageTestFile); | ||
).copySync(imageTestFilePath); | ||
File( | ||
'./test/test_files/test.pdf', | ||
).copySync(pdfTestFile); | ||
).copySync(pdfTestFilePath); | ||
File( | ||
'./test/test_files/test.yml', | ||
).copySync(yamlTestFile); | ||
).copySync(yamlTestFilePath); | ||
} | ||
|
||
tearDownTestFiles( | ||
String imageTestFile, | ||
String pdfTestFile, | ||
String yamlTestFile, | ||
String appTestFilePath, | ||
String imageTestFilePath, | ||
String pdfTestFilePath, | ||
String yamlTestFilePath, | ||
) { | ||
File(imageTestFile).deleteSync(); | ||
File(pdfTestFile).deleteSync(); | ||
File(yamlTestFile).deleteSync(); | ||
Directory(appTestFilePath).deleteSync(); | ||
File(imageTestFilePath).deleteSync(); | ||
File(pdfTestFilePath).deleteSync(); | ||
File(yamlTestFilePath).deleteSync(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters