From c13124f9bb414bfb65123b99cb05a0010d179e77 Mon Sep 17 00:00:00 2001 From: Miguel Ruivo Date: Fri, 17 Apr 2020 13:26:15 +0100 Subject: [PATCH] Addresses an issue with plugin calls on Go (Desktop) (#241) --- CHANGELOG.md | 21 ++++++++++----------- go/file_darwin.go | 34 +++++++++++++++++++++++----------- go/file_linux.go | 20 +++++++++----------- go/file_windows.go | 12 ++++++------ go/plugin.go | 20 +++++++++++++++----- pubspec.yaml | 2 +- 6 files changed, 64 insertions(+), 45 deletions(-) mode change 100644 => 100755 go/plugin.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 84d258f..757686a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,14 @@ -## 1.6.2 +## 1.6.3+1 +Addresses an issue with plugin calls on Go (Desktop) - Linux & Windows -* Updates GO (Desktop) to support multiple extension filters. +## 1.6.3 +Addresses an issue with plugin calls on Go (Desktop) - MacOS + +## 1.6.2 +Updates Go (Desktop) to support multiple extension filters. ## 1.6.1 - -* Addresses an issue that could result in permission handler resolving requests from other activities. +Addresses an issue that could result in permission handler resolving requests from other activities. ## 1.6.0 @@ -18,12 +22,10 @@ * Adds check that ensures that you one uses `FileType.custom` when providing a custom file extension filter; ## 1.5.0+2 - -* Updates channel name on iOS. +Updates channel name on iOS. ## 1.5.0+1 - -* Adds temporary workaround for (#49365)(https://github.com/flutter/flutter/issues/49365) until 1.14.6 lands on stable channel. +Adds temporary workaround for (#49365)(https://github.com/flutter/flutter/issues/49365) until 1.14.6 lands on stable channel. ## 1.5.0 @@ -31,11 +33,9 @@ * Added support for new [Android plugins APIs](https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration) (Android V2 embedding); ## 1.4.3+2 - Updates dependencies. ## 1.4.3+1 - Removes checked flutter_export_environment.sh from example app. ## 1.4.3 @@ -44,7 +44,6 @@ Removes checked flutter_export_environment.sh from example app. * Fixes an issue that could result in a crash when tapping multiple times in the same media file while picking, on some iOS devices (#171). ## 1.4.2+1 - Updates go-flutter dependencies. ## 1.4.2 diff --git a/go/file_darwin.go b/go/file_darwin.go index f8c6234..558880b 100644 --- a/go/file_darwin.go +++ b/go/file_darwin.go @@ -9,24 +9,36 @@ import ( "github.com/pkg/errors" ) -func fileFilter(method string, extensions []string, size int) (string, error) { +func fileFilter(method string, extensions []string, size int, multi bool) (string, error) { switch method { - case "any": + case "ANY": + if multi { + return "*", nil + } return `"public.item"`, nil - case "image": + case "IMAGE": + if multi { + return "jpg, jpeg, bmp, gif, png", nil + } return `"public.image"`, nil - case "audio": + case "AUDIO": + if multi { + return "mp3, wav, midi, ogg, aac", nil + } return `"public.audio"`, nil - case "video": + case "VIDEO": + if multi { + return "webm, mpeg, mkv, mp4, avi, mov, flv", nil + } return `"public.movie"`, nil - case "custom": + case "CUSTOM": var i int var filters = "" - for i = 0 ; i