diff --git a/CHANGELOG.md b/CHANGELOG.md index b0f12dd8..6043b45a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 8.0.0 +### Desktop +Removes Flutter GO support. + +### iOS +Adds privacy manifest [#1418](https://github.com/miguelpruivo/flutter_file_picker/issues/1418). + ## 7.1.0+1 Fixes typo on docs (there was some refernces to `FileType.all` instead of the correct `FileType.any`). diff --git a/README.md b/README.md index 76099c76..253e07eb 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ A package that allows you to use the native file explorer to pick single or mult ## Currently supported features * Uses OS default native pickers -* Supports multiple platforms (Mobile, Web, Desktop and Flutter GO) +* Supports multiple platforms (Mobile, Web, Desktop) * Pick files using **custom format** filtering — you can provide a list of file extensions (pdf, svg, zip, etc.) * Pick files from **cloud files** (GDrive, Dropbox, iCloud) * Single or multiple file picks @@ -56,7 +56,7 @@ See the **[File Picker Wiki](https://github.com/miguelpruivo/flutter_file_picker * [Android](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/Setup#android) * [iOS](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/Setup#ios) * [Web](https://github.com/miguelpruivo/flutter_file_picker/wiki/Setup#--web) - * [Desktop (go-flutter)](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/Setup/_edit#desktop-go-flutter) + * [Desktop](https://github.com/miguelpruivo/flutter_file_picker/wiki/Setup#--desktop) 3. [API](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/api) * [Filters](https://github.com/miguelpruivo/plugins_flutter_file_picker/wiki/API#filters) * [Parameters](https://github.com/miguelpruivo/flutter_file_picker/wiki/API#parameters) diff --git a/go/README.md b/go/README.md deleted file mode 100644 index b6bc6b5b..00000000 --- a/go/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# file_picker - -This Go package implements the host-side of the Flutter [file_picker](https://github.com/miguelpruivo/flutter_file_picker) plugin. - -## Usage - -Modify your applications `options.go`: - -``` -package main - -import ( - ... other imports .... - file_picker "github.com/miguelpruivo/flutter_file_picker/go" -) - -var options = []flutter.Option{ - ... other plugins and options ... - - flutter.AddPlugin(&file_picker.FilePickerPlugin{}), -} -``` diff --git a/go/file_darwin.go b/go/file_darwin.go deleted file mode 100644 index e8ee0072..00000000 --- a/go/file_darwin.go +++ /dev/null @@ -1,97 +0,0 @@ -package file_picker - -import ( - "fmt" - "os/exec" - "path/filepath" - "strings" - - "github.com/pkg/errors" -) - -func fileFilter(method string, extensions []string, size int, multi bool) (string, error) { - switch method { - case "any": - if multi { - return "*", nil - } - return `"public.item"`, nil - case "image": - if multi { - return "jpg, jpeg, bmp, gif, png", nil - } - return `"public.image"`, nil - case "audio": - if multi { - return "mp3, wav, midi, ogg, aac", nil - } - return `"public.audio"`, nil - case "video": - if multi { - return "webm, mpeg, mkv, mp4, avi, mov, flv", nil - } - return `"public.movie"`, nil - case "media": - if multi { - return "webm, mpeg, mkv, mp4, avi, mov, flv, jpg, jpeg, bmp, gif, png", nil - } - return `"public.audiovisual-content"`, nil - case "custom": - var i int - var filters = "" - for i = 0; i < size; i++ { - filters += extensions[i] - if i < size-1 { - filters += ", " - } - } - return filters, nil - default: - return "", errors.New("unknown method") - } - -} - -func fileDialog(title string, filter string) (string, error) { - osascript, err := exec.LookPath("osascript") - if err != nil { - return "", err - } - - output, err := exec.Command(osascript, "-e", `choose file of type {`+filter+`} with prompt "`+title+`"`).Output() - if err != nil { - if exitError, ok := err.(*exec.ExitError); ok { - fmt.Printf("miguelpruivo/plugins_flutter_file_picker/go: file dialog exited with code %d and output `%s`\n", exitError.ExitCode(), string(output)) - return "", nil // user probably canceled or closed the selection window - } - return "", errors.Wrap(err, "failed to open file dialog") - } - - trimmedOutput := strings.TrimSpace(string(output)) - - pathParts := strings.Split(trimmedOutput, ":") - path := string(filepath.Separator) + filepath.Join(pathParts[1:]...) - return path, nil -} - -func dirDialog(title string) (string, error) { - osascript, err := exec.LookPath("osascript") - if err != nil { - return "", err - } - - output, err := exec.Command(osascript, "-e", `choose folder with prompt "`+title+`"`).Output() - if err != nil { - if exitError, ok := err.(*exec.ExitError); ok { - fmt.Printf("miguelpruivo/plugins_flutter_file_picker/go: folder dialog exited with code %d and output `%s`\n", exitError.ExitCode(), string(output)) - return "", nil // user probably canceled or closed the selection window - } - return "", errors.Wrap(err, "failed to open folder dialog") - } - - trimmedOutput := strings.TrimSpace(string(output)) - - pathParts := strings.Split(trimmedOutput, ":") - path := string(filepath.Separator) + filepath.Join(pathParts[1:]...) - return path, nil -} diff --git a/go/file_linux.go b/go/file_linux.go deleted file mode 100644 index 98e5d7c3..00000000 --- a/go/file_linux.go +++ /dev/null @@ -1,47 +0,0 @@ -package file_picker - -import ( - "github.com/gen2brain/dlgs" - "github.com/pkg/errors" -) - -func fileFilter(method string, extensions []string, size int, isMulti bool) (string, error) { - switch method { - case "any": - return `*.*`, nil - case "image": - return `*.png *.jpg *.jpeg`, nil - case "audio": - return `*.mp3 *.wav *.midi *.ogg *.aac`, nil - case "video": - return `*.webm *.mpeg *.mkv *.mp4 *.avi *.mov *.flv`, nil - case "media": - return `*.png *.jpg *.jpeg *.webm *.mpeg *.mkv *.mp4 *.avi *.mov *.flv`, nil - case "custom": - var i int - var filters = "" - for i = 0; i < size; i++ { - filters += `*.` + extensions[i] + ` ` - } - return filters, nil - default: - return "", errors.New("unknown method") - } - -} - -func fileDialog(title string, filter string) (string, error) { - filePath, _, err := dlgs.File(title, filter, false) - if err != nil { - return "", errors.Wrap(err, "failed to open dialog picker") - } - return filePath, nil -} - -func dirDialog(title string) (string, error) { - dirPath, _, err := dlgs.File(title, "", true) - if err != nil { - return "", errors.Wrap(err, "failed to open dialog picker") - } - return dirPath, nil -} diff --git a/go/file_unsupported.go b/go/file_unsupported.go deleted file mode 100644 index 9c9b5b31..00000000 --- a/go/file_unsupported.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build !darwin,!linux,!windows - -package file_picker - -import ( - "github.com/pkg/errors" -) - -func fileFilter(method string) (string, error) { - return "", errors.New("platform unsupported") -} - -func fileDialog(title string, filter string) (string, error) { - return "", errors.New("platform unsupported") -} - -func dirDialog(title string, filter string) (string, error) { - return "", errors.New("platform unsupported") -} diff --git a/go/file_windows.go b/go/file_windows.go deleted file mode 100644 index 3a16f131..00000000 --- a/go/file_windows.go +++ /dev/null @@ -1,47 +0,0 @@ -package file_picker - -import ( - "github.com/gen2brain/dlgs" - "github.com/pkg/errors" -) - -func fileFilter(method string, extensions []string, size int, isMulti bool) (string, error) { - switch method { - case "any": - return "*", nil - case "image": - return "Images (*.jpeg,*.png,*.gif)\x00*.jpg;*.jpeg;*.png;*.gif\x00All Files (*.*)\x00*.*\x00\x00", nil - case "audio": - return "Audios (*.mp3)\x00*.mp3\x00All Files (*.*)\x00*.*\x00\x00", nil - case "video": - return "Videos (*.webm,*.wmv,*.mpeg,*.mkv,*.mp4,*.avi,*.mov,*.flv)\x00*.webm;*.wmv;*.mpeg;*.mkv;*mp4;*.avi;*.mov;*.flv\x00All Files (*.*)\x00*.*\x00\x00", nil - case "media": - return "Videos (*.webm,*.wmv,*.mpeg,*.mkv,*.mp4,*.avi,*.mov,*.flv)\x00*.webm;*.wmv;*.mpeg;*.mkv;*mp4;*.avi;*.mov;*.flv\x00Images (*.jpeg,*.png,*.gif)\x00*.jpg;*.jpeg;*.png;*.gif\x00All Files (*.*)\x00*.*\x00\x00", nil - case "custom": - var i int - var filters = "Files (" - for i = 0; i < size; i++ { - filters += `*.` + extensions[i] + `,` - } - filters += ")" - return filters, nil - default: - return "", errors.New("unknown method") - } -} - -func fileDialog(title string, filter string) (string, error) { - filePath, _, err := dlgs.File(title, filter, false) - if err != nil { - return "", errors.Wrap(err, "failed to open dialog picker") - } - return filePath, nil -} - -func dirDialog(title string) (string, error) { - dirPath, _, err := dlgs.File(title, `*.*`, true) - if err != nil { - return "", errors.Wrap(err, "failed to open dialog picker") - } - return dirPath, nil -} diff --git a/go/go.mod b/go/go.mod deleted file mode 100644 index b24a1edd..00000000 --- a/go/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/miguelpruivo/flutter_file_picker/go - -go 1.13 - -require ( - github.com/gen2brain/dlgs v0.0.0-20190708095831-3854608588f7 - github.com/go-flutter-desktop/go-flutter v0.30.0 - github.com/gopherjs/gopherjs v0.0.0-20190915194858-d3ddacdb130f // indirect - github.com/pkg/errors v0.8.1 -) diff --git a/go/go.sum b/go/go.sum deleted file mode 100644 index 56eb711c..00000000 --- a/go/go.sum +++ /dev/null @@ -1,19 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gen2brain/dlgs v0.0.0-20190708095831-3854608588f7 h1:qA8Mdjwrlv/r/aMqArqO0IMHUiy6ApdW4+8DtKr7PvA= -github.com/gen2brain/dlgs v0.0.0-20190708095831-3854608588f7/go.mod h1:/eFcjDXaU2THSOOqLxOPETIbHETnamk8FA/hMjhg/gU= -github.com/go-flutter-desktop/go-flutter v0.30.0 h1:tKQSB7rUOR0o9Bq5P7VpTm0KAOHxvRwC1xDlJGlWNY4= -github.com/go-flutter-desktop/go-flutter v0.30.0/go.mod h1:NCryd/AqiRbYSd8pMzQldYkgH1tZIFGt2ToUghZcWGA= -github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw= -github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/gopherjs/gopherjs v0.0.0-20190915194858-d3ddacdb130f h1:TyqzGm2z1h3AGhjOoRYyeLcW4WlW81MDQkWa+rx/000= -github.com/gopherjs/gopherjs v0.0.0-20190915194858-d3ddacdb130f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/go/import.go.tmpl b/go/import.go.tmpl deleted file mode 100644 index f398fda0..00000000 --- a/go/import.go.tmpl +++ /dev/null @@ -1,13 +0,0 @@ -package main - -// DO NOT EDIT, this file is generated by hover at compile-time for the testplu2 plugin. - -import ( - flutter "github.com/go-flutter-desktop/go-flutter" - file_picker "github.com/miguelpruivo/plugins_flutter_file_picker/go" -) - -func init() { - // Only the init function can me tweaked by plugin maker. - options = append(options, flutter.AddPlugin(&file_picker.FilePickerPlugin{})) -} diff --git a/go/plugin.go b/go/plugin.go deleted file mode 100755 index 67f7b0e5..00000000 --- a/go/plugin.go +++ /dev/null @@ -1,125 +0,0 @@ -package file_picker - -import ( - "encoding/json" - "github.com/gen2brain/dlgs" - "github.com/go-flutter-desktop/go-flutter" - "github.com/go-flutter-desktop/go-flutter/plugin" - "github.com/pkg/errors" - "os" - "path/filepath" -) - -const channelName = "miguelruivo.flutter.plugins.filepicker" - -type FilePickerPlugin struct{} - -var _ flutter.Plugin = &FilePickerPlugin{} // compile-time type check - -func (p *FilePickerPlugin) InitPlugin(messenger plugin.BinaryMessenger) error { - channel := plugin.NewMethodChannel(messenger, channelName, plugin.JSONMethodCodec{}) - channel.CatchAllHandleFunc(p.handleFilePicker) - return nil -} - -func (p *FilePickerPlugin) handleFilePicker(methodCall interface{}) (reply interface{}, err error) { - method := methodCall.(plugin.MethodCall).Method - - if "dir" == method { - dirPath, err := dirDialog("Select a directory") - if err != nil { - return nil, errors.Wrap(err, "failed to open dialog picker") - } - return dirPath, nil - } - - var arguments map[string]interface{} - - err = json.Unmarshal(methodCall.(plugin.MethodCall).Arguments.(json.RawMessage), &arguments) - if err != nil { - return nil, errors.Wrap(err, "failed to decode arguments") - } - - var allowedExtensions []string - - // Parse extensions - if arguments != nil && arguments["allowedExtensions"] != nil { - allowedExtensions = make([]string, len(arguments["allowedExtensions"].([]interface{}))) - for i := range arguments["allowedExtensions"].([]interface{}) { - allowedExtensions[i] = arguments["allowedExtensions"].([]interface{})[i].(string) - } - } - - selectMultiple, ok := arguments["allowMultipleSelection"].(bool) //method.Arguments.(bool) - if !ok { - return nil, errors.Wrap(err, "invalid format for argument, not a bool") - } - - filter, err := fileFilter(method, allowedExtensions, len(allowedExtensions), selectMultiple) - if err != nil { - return nil, errors.Wrap(err, "failed to get filter") - } - - withData, ok := arguments["withData"].(bool) - - var selectedFilePaths []string - - if selectMultiple { - filePaths, _, err := dlgs.FileMulti("Select one or more files", filter) - if err != nil { - return nil, errors.Wrap(err, "failed to open dialog picker") - } - - selectedFilePaths = make([]string, len(filePaths)) - - for i, filePath := range filePaths { - selectedFilePaths[i] = filePath - } - } else { - selectedFilePaths = make([]string, 1) - - filePath, err := fileDialog("Select a file", filter) - if err != nil { - return nil, errors.Wrap(err, "failed to open dialog picker") - } - - selectedFilePaths[0] = filePath - } - - result := make([]map[string]interface{}, len(selectedFilePaths)) - - for i, filePath := range selectedFilePaths { - file, err := os.Open(filePath) - if err != nil { - return nil, errors.Wrap(err, "Can't open selected file") - } - - fi, err := file.Stat() - if err != nil { - return nil, errors.Wrap(err, "Can't open selected file") - } - - var bytes []byte - - if withData { - _, err := file.Read(bytes) - if err != nil { - return nil, errors.Wrap(err, "Can't read selected file") - } - } - - result[i] = map[string]interface{}{ - "path": filePath, - "name": filepath.Base(filePath), - "bytes": bytes, - "size": fi.Size(), - } - - err = file.Close() - if err != nil { - return nil, errors.Wrap(err, "Can't close selected file after reading") - } - } - - return result, nil -} diff --git a/ios/Resources/PrivacyInfo.xcprivacy b/ios/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..0eca193e --- /dev/null +++ b/ios/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,14 @@ + + + + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + + + \ No newline at end of file diff --git a/ios/file_picker.podspec b/ios/file_picker.podspec index 0d429a2c..5a8501a7 100644 --- a/ios/file_picker.podspec +++ b/ios/file_picker.podspec @@ -31,6 +31,7 @@ A flutter plugin to show native file picker dialogs. preprocess_definitions << "PICKER_DOCUMENT=1" end s.pod_target_xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => preprocess_definitions.join(' ') } + s.resource_bundles = {'file_picker_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']} end diff --git a/lib/src/file_picker_macos.dart b/lib/src/file_picker_macos.dart index ce176e70..a0b13e98 100644 --- a/lib/src/file_picker_macos.dart +++ b/lib/src/file_picker_macos.dart @@ -181,7 +181,10 @@ class FilePickerMacOS extends FilePicker { return arguments; } - String escapeDialogTitle(String dialogTitle) => dialogTitle.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', '\\\n'); + String escapeDialogTitle(String dialogTitle) => dialogTitle + .replaceAll('\\', '\\\\') + .replaceAll('"', '\\"') + .replaceAll('\n', '\\\n'); /// Transforms the result string (stdout) of `osascript` into a [List] of /// POSIX file paths. @@ -190,8 +193,12 @@ class FilePickerMacOS extends FilePicker { return []; } - final paths = - fileSelectionResult.trim().split(', alias ').map((String path) => path.trim()).where((String path) => path.isNotEmpty).toList(); + final paths = fileSelectionResult + .trim() + .split(', alias ') + .map((String path) => path.trim()) + .where((String path) => path.isNotEmpty) + .toList(); if (paths.length == 1 && paths.first.startsWith('file ')) { // The first token of the first path is "file" in case of the save file diff --git a/pubspec.yaml b/pubspec.yaml index c5cf4fb6..18408e51 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A package that allows you to use a native file explorer to pick sin homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker repository: https://github.com/miguelpruivo/flutter_file_picker issue_tracker: https://github.com/miguelpruivo/flutter_file_picker/issues -version: 7.1.0+1 +version: 8.0.0 dependencies: flutter: diff --git a/test/file_picker_macos_test.dart b/test/file_picker_macos_test.dart index 12d9f283..5b37595d 100644 --- a/test/file_picker_macos_test.dart +++ b/test/file_picker_macos_test.dart @@ -37,7 +37,9 @@ void main() { ); }); - test('should return the file filter when given a list of custom file extensions', () { + test( + 'should return the file filter when given a list of custom file extensions', + () { final picker = FilePickerMacOS(); // TODO: the first empty file type ("", ) is required in some cases, e.g. @@ -117,7 +119,8 @@ void main() { ); expect(filePaths.length, equals(1)); - expect(filePaths[0], equals('/Volumes/macOS/Users/john/Downloads/config.yml')); + expect(filePaths[0], + equals('/Volumes/macOS/Users/john/Downloads/config.yml')); }); test('should interpret the result of picking two files', () { @@ -140,10 +143,13 @@ void main() { ); expect(filePaths.length, equals(1)); - expect(filePaths[0], equals('/Volumes/macOS/System/iOSSupport/usr/lib/swift')); + expect(filePaths[0], + equals('/Volumes/macOS/System/iOSSupport/usr/lib/swift')); }); - test('should interpret the result of picking a file from an external hard drive', () { + test( + 'should interpret the result of picking a file from an external hard drive', + () { final picker = FilePickerMacOS(); final filePaths = picker.resultStringToFilePaths( @@ -158,7 +164,9 @@ void main() { ), ); }); - test('should interpret the result of picking multiple files from an external hard drive', () { + test( + 'should interpret the result of picking multiple files from an external hard drive', + () { final picker = FilePickerMacOS(); final filePaths = picker.resultStringToFilePaths( @@ -166,12 +174,15 @@ void main() { ); expect(filePaths.length, equals(3)); - expect(filePaths[0], equals('/Volumes/WD Backup/photos/my screenshot.jpg')); + expect( + filePaths[0], equals('/Volumes/WD Backup/photos/my screenshot.jpg')); expect(filePaths[1], equals('/Volumes/WD Backup/photos/christmas.png')); expect(filePaths[2], equals('/Volumes/WD Backup/photos/image33.png')); }); - test('should interpret the result of picking a directory from an external hard drive', () { + test( + 'should interpret the result of picking a directory from an external hard drive', + () { final picker = FilePickerMacOS(); final filePaths = picker.resultStringToFilePaths( @@ -185,7 +196,9 @@ void main() { ); }); - test('should interpret the result of picking filenames that contain blanks and commas', () { + test( + 'should interpret the result of picking filenames that contain blanks and commas', + () { final picker = FilePickerMacOS(); final filePaths = picker.resultStringToFilePaths( @@ -247,7 +260,8 @@ void main() { expect( cliArguments.join(' '), - equals('-e choose file name default name "test.out" with prompt "Select output file:"'), + equals( + '-e choose file name default name "test.out" with prompt "Select output file:"'), ); }); @@ -268,7 +282,9 @@ void main() { ); }); - test('should generate the arguments for picking a single file with a custom file filter', () { + test( + 'should generate the arguments for picking a single file with a custom file filter', + () { final picker = FilePickerMacOS(); final cliArguments = picker.generateCommandLineArguments( @@ -280,11 +296,14 @@ void main() { expect( cliArguments.join(' '), - equals('-e choose file of type {"dart", "yml"} with prompt "Select a file:"'), + equals( + '-e choose file of type {"dart", "yml"} with prompt "Select a file:"'), ); }); - test('should generate the arguments for picking multiple files with a custom file filter', () { + test( + 'should generate the arguments for picking multiple files with a custom file filter', + () { final picker = FilePickerMacOS(); final cliArguments = picker.generateCommandLineArguments( @@ -316,7 +335,9 @@ void main() { ); }); - test('should generate the arguments for picking a file when an initial directory is given', () { + test( + 'should generate the arguments for picking a file when an initial directory is given', + () { final picker = FilePickerMacOS(); final cliArguments = picker.generateCommandLineArguments( @@ -326,11 +347,14 @@ void main() { expect( cliArguments.join(' '), - equals('-e choose file default location "/Users/john/Desktop" with prompt "Pick a file:"'), + equals( + '-e choose file default location "/Users/john/Desktop" with prompt "Pick a file:"'), ); }); - test('should generate the arguments for picking a directory when an initial directory is given', () { + test( + 'should generate the arguments for picking a directory when an initial directory is given', + () { final picker = FilePickerMacOS(); final cliArguments = picker.generateCommandLineArguments( @@ -342,11 +366,14 @@ void main() { expect( cliArguments.join(' '), - equals('-e choose folder default location "/Users/john/workspace" with prompt "Pick directory:"'), + equals( + '-e choose folder default location "/Users/john/workspace" with prompt "Pick directory:"'), ); }); - test('should generate the arguments for saving a file when an initial directory is given', () { + test( + 'should generate the arguments for saving a file when an initial directory is given', + () { final picker = FilePickerMacOS(); final cliArguments = picker.generateCommandLineArguments( @@ -358,7 +385,8 @@ void main() { expect( cliArguments.join(' '), - equals('-e choose file name default name "output.pdf" default location "/Users/john/Downloads" with prompt "Save as:"'), + equals( + '-e choose file name default name "output.pdf" default location "/Users/john/Downloads" with prompt "Save as:"'), ); }); });