-
Notifications
You must be signed in to change notification settings - Fork 282
Need code review for file_picker plungin and test on darwin / linux before merge to pub.dev #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From what I can tell, you are trying to port miguelpruivo/plugins_flutter_file_picker to go-flutter, it's awesome! As @miguelpruivo said:
Can you please submit a PR to https://github.com/miguelpruivo/plugins_flutter_file_picker with the content of https://github.com/chunhunghan/file_picker in a directory The linux plugin works fine. (Just remove the unnecessary print):
|
Also the https://github.com/flutter/plugins/tree/master/packages/file_picker url in the README is wrong. |
@Drakirus Thank you for your review @GeertJohan could you help to check darwin? Thank you very much. |
@chunhunghan great work! |
@chunhunghan GeertJohan is in vacation, @zephylac, can you give this a try? |
I was doing it. Having this issue RN
|
@zephylac you are on an older version of go-flutter and hover, update hover. |
I'm using thisexample In your plugin package fmt is imported but no used. The finder doesn't open except when I choose 'any' extension. |
I have folk miguelpruivo 's project version v1.3.8 to https://github.com/chunhunghan/plugins_flutter_file_picker I have checked with Windows 10. It works fine. The reason of error is Flutter Text Widget received a nil from file_picker.go. I don't know correct filter string of darwin, so I just copy it from image_picker file_darwin.go
file_picker
I am so sorry. |
@chunhunghan by providing desktop support, as well as some other working fixes, the version will most likely jump to Anyway, take your time and feel free to issue a PR to the file_picker Thank you. |
I have ask question in apple.stackexchange Maybe for ANY, I should pass an empty string to disable "of type" |
I found the Apple developper page. By following the rules I ended up with :
This solution works on MacOS High Sierra 10.13 . We should test it on Mojave but I don't see any reasons why it wouldn't work. I tested multiples files option, it works and I couldn't reproduce the error I shown in my previous comment. |
@zephylac Thank you very much. Do I need to uppercase file extension in CUSTOM? Thanks |
You just need to replace
by
The double-quotes are messing up the filter. Also I noticed when the dialog is open, it isn't focused. There should be a way to make it focus on display to avoid this issue. |
filter had replaced. Thank you very much. #141 ? |
The main problem here is that the dialog windows is not focused when started. That's why we need to find a way to focus the dialog window when it opens to avoid this error. |
@chunhunghan, as @stuartmorgan said in #209, we should consider adding a |
I’d suggest to call the directory only |
go-flutter plugins are not compatible with FDE plugins and flutter-rs plugins. opinion: |
To clarify slightly: the plugin API is part of what moved to the Flutter project, so it's not really "FDE plugins" anymore. They would just be Flutter plugins, with support for one or more of Flutter's desktop platforms. |
I found a applescript command
might useful here https://apple.stackexchange.com/questions/34810/create-a-command-to-focus-a-specific-window-from-anywhere-in-os
but I do not have Mac and it's impossible for me to test it. |
Either you follow dlgs logic and use osascript or you can try to re-implement the whole package in glfw. Which would reduce the dependancy graph. For osascript here is an example :
This solution kinda works, it set the file dialog window above all the others but doesn't focus it and when you are using gesture to switch between desktop/application. It set the file dialog above all the other even when you are another application (meaning that this solution is too intrusive). |
Aren't all file picker like that? |
It would seems like it but the go pkg which is dlgs doesn't let you focus the windows. The only issue with that is that you can't press ESC until you have clicked on the dialog. osascript is specific to Mac OS meaning we would have to find fixes for Linux & Windows. This solution is kinda makeshift repair. I don't like the way it's being handled. |
@chunhunghan @zephylac, the plug-in does work, a beta version can be released. If @miguelpruivo is still OK, @chunhunghan you can create a PR on https://github.com/miguelpruivo/plugins_flutter_file_picker under the Conserning the notice about the issue tracker in the Readme, I suggest using the miguelpruivo/plugins_flutter_file_picker one instead of go-flutter. |
FWIW, getting correct behavior on macOS using that approach is going to be impossible. It's launching a completely separate process to show the dialog box, which means that it can never have the correct (window-level or application-level) modality, and if it's not system-model you'll have issues with anything application-level (hiding the app, app switcher, etc.) That Go package might make sense in the context of an otherwise-headless Go script, but it's not at all the right way to implement showing a dialog box from within the context of an application. |
Currently, what’s the advantage of Flutter GO vs the Flutter Desktop? |
@miguelpruivo I have written a comment in #191 about go-flutter and Flutter Desktop (previously FDE). If you don't have a clear idea of what go-flutter brings, you might want to reconsider adding go-flutter support to your plug-in 😉. |
@Drakirus thank you for clarifying. I got the concept from the discussion here and README file, however, I was looking for a more detailed explanation about the main reasons that took you to work on this, and #191 explained it quite well. 👍 However, I must admit that I'm going to give it a try before merging it, but definitely I don't see a reason why it shouldn't as it also adds more value for GO-Flutter users. 🙂 |
Thank you all you are amazing. |
I have tested on Windows 10. It works fine.
But I only have Windows, can't test on linux and darwin
Could you please help me.
Thanks.
plugin
https://github.com/chunhunghan/file_picker
android
https://github.com/chunhunghan/file_picker_example
The text was updated successfully, but these errors were encountered: