-
Notifications
You must be signed in to change notification settings - Fork 626
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
Support for MacOS & Windows Desktop #271
Comments
This plugin already has Desktop support through Flutter Go. You may want to take a look. As Flutter Desktop itself is on a really early stage, I don’t have plans for it right now and it’s a low priority feature. However, support for Flutter Web is being added in the next days. Thanks! |
Good news is I added support to |
@miguelpruivo Could you provide some hints, what would be necessary to add support for macOS? The NeoSEALs team is happy to provide a respective PR 🚀 |
nothing helpful, just reminder that it does not work with macos
|
Hi guys, it's pretty clear at this moment that this plugin doesn't support MacOS (only through Flutter go). Otherwise I'd have added it on supported features. This might come in a feature, but for the time being, there are other priorities in the line. Thank you! |
Support for MacOS should now be an easy go since file_picker 2.0.0, because all platforms are now merged. Looking forward it as soon as I have time, but feel free to issue a PR if you have any chance. |
I'm testing now, but getting MissingPluginException Do I need do something more to work on mac desktop? |
@Katekko it's not yet implemented. For now, you can use Go implementation, which is supported by MacOS (and all other desktop platforms). |
I sorry. So I just need follow the instructions on readme? |
I have tested a sample application for selecting files in Flutter Windows desktop. Only "Select folder" function works (including a couple of fixes) |
Flutter support for desktop has matured a lot since may, are there any plans to support desktop OSs natively by now? |
@vware might be a possibility yes. However currently I don’t have a windows machine so it won’t be easy to test it out on all three. |
thanks for the quick reply. just in case people look for a google-ish interim solution, there is a plugin that's part of the flutter desktop embedding effort: file_chooser: |
Just adding my support for this feature. I would love to help but have no idea how flutter plugins work. Is there anyway I can help? |
Was this supposed to be fixed by #382 or is that something else? |
Try this on M1 based MacOS, it works, just got null path.
|
This feature would be very useful, I had to remove this package from my project and use filepicker_windows or file_picker_cross analyzing which, Flutter go limited me a lot. |
I can help with implementing a native desktop support without Flutter Go / Golang. In my case, Flutter Go / hover caused unstable / randomly crashing builds. I also experienced a lot of exceptions w.r.t. keyboard input which made me replace this plugin (
I have a working implementation for Windows and Linux. I cannot implement or test the MacOS version though. @miguelpruivo are you interested in replacing the existing Go code with Dart code so that Go Flutter won't be needed anymore? If so, then I'd be happy to share my code and help to integrate it into your existing Flutter package. Please note, that my implementation has dependencies on the Dart packages ffi and path. |
I'd like to vote for this feature. hover is 2 years old and still alpha - not promising. |
@miguelpruivo is very busy so I decided to publish my own package https://pub.dev/packages/file_picker_desktop I tried to keep the API of my package as close as possible to the API of Miguel's package. So far, I have only published a pre-release @softwaresinc Could you please test the macOS version and give me feedback? The Git repository of my Dart package contains an example Flutter app for manually testing the file picker. |
NIce job @philenius, |
@Katekko I tested the file_picker_desktop on MacOS. |
@softwaresinc thank you for testing and reporting. I found the bug (the command line arguments for osascript were wrapped 2x in quotes which caused osascript to terminate immediately). I tested it on a friend's MacBook and released a new version. Thanks again. @Katekko thank you. No, unfortunately my implementation only works on the desktop (Windows, macOS, and Linux). Ideally my code could be combined with Miguel's package so that people who want to support all platforms (without requiring Go Flutter) don't need the dependency on two separate packages.
I haven't invested a lot of time but I tried and I couldn't figure out how to combine Miguel's plugin package with my implementation in Dart for Windows, macOS, and Linux. |
@philenius thank you for your effort on this. Ideally and to keep things simple I’d rather add you as a maintainer of this package and merge the two together to provide a seamless experience across all platforms. For now, until you have it all fully tested out it’s not a bad idea to have it as standalone package and then eventually deprecate it as soon as it’s merged with this one. Currently I only have MacOS (and Windows through bootcamp) so I can’t fully test it. Let me know your thoughts. |
@miguelpruivo: I also think that merging my Dart implementation with your existing package would be a benefit for the Flutter community. Thank you for offering to cooperate on this. So, yes, I'd be happy to contribute my implementation! Thanks to @softwaresinc I was able to fix the macOS implementation. As of right now, I'm not aware of any further bugs in my implementation. I also wrote unit tests and added a CI pipeline via GitHub Actions. Frankly, unit tests cannot test the actual invocation of the file picker GUI. Of course I've manually tested the Linux and Windows version (I've included an example app in my GitHub repo). To be on the safe side, I'd say let's wait a few weeks until more users have used my package. I already figured out how to integrate my Dart code into your plugin package. We would have to extend the ...
flutter:
plugin:
platforms:
android:
package: com.mr.flutter.plugin.filepicker
pluginClass: FilePickerPlugin
ios:
pluginClass: FilePickerPlugin
linux:
pluginClass: FilePickerPlugin
fileName: _internal/file_picker_linux.dart
macos:
pluginClass: FilePickerPlugin
fileName: _internal/file_picker_macos.dart
web:
pluginClass: FilePickerWeb
fileName: _internal/file_picker_web.dart
windows:
pluginClass: FilePickerPlugin
fileName: _internal/file_picker_windows.dart |
@philenius that looks good to me. Is there any feature that you didn't manage to support on some platform or it was an easy port? I'm talking specifically of file type filters, multiple picks, picking directories and so on. |
Looking forward to the merger of "file_picker_desktop" and "file_picker" |
I think the longer you wait the more people will rely on both packages and are forced to refactor their code in order to use the original package. Therefore I would love to see you integrating it sooner than later 😉 |
@miguelpruivo, luckily I copied your interfaces, classes, and enums (while giving credit of course). There are only a few changes that I've made:
Other than that, everything works the same.
In summary, I just read the code of You can try out my example app to verify that it works 😉 https://github.com/philenius/flutter_file_picker_desktop/tree/master/example @avbk good point, let's get this done sooner than later 👍 |
@philenius much thank you for your effort. I'll take a look ASAP and merge it if it seems ok — after that you'll still be able to maintain it on this repo since all of the effort regarding the desktop platforms were yours. |
@philenius on a first attempt seems to be working properly on MacOS. I'll merge it and update the docs accordingly. Then you can still maintain it. 🙂 I suggest you to deprecate your other published package to not confuse the users and prevent opening unnecessary issues. Thank you very much. |
@philenius version 4.0.0 is out with your plugin merged. 🎉 Feel free to discontinue it if you want and I'll give you maintainer permissions so you could still work on it if you want on this repo. Thank you! |
I'm kind of confused with go-flutter still mentioned in the README and wiki. |
Because it is still supported @bernaferrari. |
Can you mention why/when it is needed, what are the differences? Or if the new way is better, but it is still kept for compatibility. |
@bernaferrari it's there for backward compatibility only, since there could be some devs that still use it. If you haven't use it yet, go for the native way, since it's already supported. |
idk i use this on linux...
is this something anyone aware of? or am i doing something wrong? i literally just called String? path = await FilePicker.platform.getDirectoryPath(); |
@alexmercerind which version of |
I get a platform exception trying to use this in a flutter app deployed to MacOS, but it works on android and iOS. Are there any plans to extend support to native mac / desktop?
Thanks!
The text was updated successfully, but these errors were encountered: