path_provider_fde including support for additional macOS related paths

148 views
Skip to first unread message

Tom Verbeek

unread,
Dec 5, 2019, 9:18:59 AM12/5/19
to Desktop Embedding for Flutter
The flutter-desktop-embedding repo has a plugin that allows for getting paths from macOS that are also available on mobile platforms.

We are writing a desktop app, that needs to know the user configured downloads path (where the user wants downloads to be stored). 
Unfortunately this path is not supported by the path_provider_fde plugin, so I extended this plugin with the following macOS relevant paths:

downloadsDirectory
The user’s downloads directory.

musicDirectory
The user’s Music directory (~/Music).

picturesDirectory
The user’s Pictures directory (~/Pictures).

case moviesDirectory
The user’s Movies directory (~/Movies).


I think those paths may be relevant for a flutter desktop app to store data to, or to read data from.

Would it be of interest to offer this addition as a pull request on github?

Chris Sells

unread,
Dec 5, 2019, 12:28:41 PM12/5/19
to Tom Verbeek, Desktop Embedding for Flutter
yes please!

--
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-desktop-embedding-dev/a76e04a8-9e45-4486-b071-87609280213c%40googlegroups.com.

Francisco Magdaleno Arceo

unread,
Dec 5, 2019, 12:34:18 PM12/5/19
to Chris Sells, Tom Verbeek, Desktop Embedding for Flutter
FWIW, I have a PR to move the FDE plugin into flutter/plugins. I can add those there :)  https://github.com/flutter/plugins/pull/2342

Stuart Morgan

unread,
Dec 5, 2019, 9:15:52 PM12/5/19
to Francisco Magdaleno Arceo, Chris Sells, Tom Verbeek, Desktop Embedding for Flutter
I think there's a discussion to be had (which can happen in a PR on flutter/plugins once the plugin has moved) about what layer those methods would belong at. downloadsDirectory likely makes sense at the top level, returning null on mobile, since it will apply to multiple platforms. Music/Pictures/Movies are, on the other hand, macOS specific as far as I know, so would probably be better in a macOS-level API extension. That's something that the federated plugin document proposed as a way of handling cases where there are methods that would be specific to a single implementation.

-Stuart

Tom Verbeek

unread,
Dec 6, 2019, 3:44:03 AM12/6/19
to Desktop Embedding for Flutter
Francisco, that would be great! As I can see, you already put a lot of work into making this a macOS plugin which is part of flutter itself. So, please add the 4 paths as mentioned above to your PR.


On Thursday, December 5, 2019 at 6:34:18 PM UTC+1, Francisco Magdaleno Arceo wrote:
FWIW, I have a PR to move the FDE plugin into flutter/plugins. I can add those there :)  https://github.com/flutter/plugins/pull/2342

On Thu, Dec 5, 2019 at 9:28 AM 'Chris Sells' via Desktop Embedding for Flutter <flutter-desktop-embedding-d...@googlegroups.com> wrote:
yes please!

On Thu, Dec 5, 2019 at 6:19 AM Tom Verbeek <techn...@gmail.com> wrote:
The flutter-desktop-embedding repo has a plugin that allows for getting paths from macOS that are also available on mobile platforms.

We are writing a desktop app, that needs to know the user configured downloads path (where the user wants downloads to be stored). 
Unfortunately this path is not supported by the path_provider_fde plugin, so I extended this plugin with the following macOS relevant paths:

downloadsDirectory
The user’s downloads directory.

musicDirectory
The user’s Music directory (~/Music).

picturesDirectory
The user’s Pictures directory (~/Pictures).

case moviesDirectory
The user’s Movies directory (~/Movies).


I think those paths may be relevant for a flutter desktop app to store data to, or to read data from.

Would it be of interest to offer this addition as a pull request on github?

--
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embedding-dev+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embedding-dev+unsub...@googlegroups.com.

Stuart Morgan

unread,
Dec 6, 2019, 10:12:01 AM12/6/19
to Tom Verbeek, Desktop Embedding for Flutter
On Fri, Dec 6, 2019 at 12:44 AM Tom Verbeek <techn...@gmail.com> wrote:
So, please add the 4 paths as mentioned above to your PR.

Adding completely new functionality should be done separately from adding macOS support for the plugin as it currently exists, especially since there are open design questions about the former. I would recommend waiting for Francisco's PR to land, then opening a new PR to propose your new APIs.

-Stuart 

Francisco Magdaleno Arceo

unread,
Dec 6, 2019, 11:23:21 AM12/6/19
to Stuart Morgan, Tom Verbeek, Desktop Embedding for Flutter
Yeah, I was actually planning on doing some refactoring to the macos plugins once they land to conform to the federated structure.

--
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-desktop-embedding-dev/CABEeGCeJbCL%2BYaNvP2kS0dGB8QD-qSbtotNgJ1upwP4hNzd5XA%40mail.gmail.com.

Kris Giesing

unread,
Dec 6, 2019, 1:05:22 PM12/6/19
to Stuart Morgan, Francisco Magdaleno Arceo, Chris Sells, Tom Verbeek, Desktop Embedding for Flutter
Windows also has standard media-related folders per user. Linux does not have standards but certain desktop environments have them too.

I don't exactly know how to shape the best cross-platform API for this, but there are certain similarities we might be able to leverage.

Kris Giesing

unread,
Dec 6, 2019, 1:06:47 PM12/6/19
to Stuart Morgan, Francisco Magdaleno Arceo, Chris Sells, Tom Verbeek, Desktop Embedding for Flutter
But +1 to doing this as a separate effort from Francisco's PR.

Tom Verbeek

unread,
Dec 9, 2019, 3:47:07 AM12/9/19
to Desktop Embedding for Flutter
Great, we'll wait for the integration of Francisco's PR. Windows support would also be very important for us.

Stuart Morgan

unread,
Dec 9, 2019, 12:59:44 PM12/9/19
to Tom Verbeek, Desktop Embedding for Flutter
On Mon, Dec 9, 2019 at 12:47 AM Tom Verbeek <techn...@gmail.com> wrote:
Windows support would also be very important for us.

Windows implementations of any plugins in the FDE repository are definitely welcome.

-Stuart

Tom Verbeek

unread,
Dec 20, 2019, 9:08:18 AM12/20/19
to Desktop Embedding for Flutter
Franciscos PR got merged - this is great! How do we move forward to include support for additional platform dependent paths?

Most importantly we would need a way to retrieve the operating system's downloads directory. Support for macOS would be easy to implement here:

Since you offered to add this to your PR, @Francisco, could I ask you  to proceed with this?

Stuart Morgan

unread,
Dec 20, 2019, 4:51:10 PM12/20/19
to Tom Verbeek, Desktop Embedding for Flutter
On Fri, Dec 20, 2019 at 6:08 AM Tom Verbeek <techn...@gmail.com> wrote:
Franciscos PR got merged - this is great! How do we move forward to include support for additional platform dependent paths?

The next step would be to get agreement with the flutter/plugins team about what layer to add the new APIs. Top-level, but unimplemented on mobile? Per-platform only on the platforms where it makes sense? A new package for adding desktop-specific APIs, shared among desktop? Filing an issue with your request would be the best way to capture a discussion about that and bring in the right people.
 
Since you offered to add this to your PR, @Francisco, could I ask you  to proceed with this?

If this is something you're interested in, I would strongly recommend driving it yourself. There is a ton of work to do for desktop in general, and we are spread thin, so it's hard to say when we would get to this otherwise.

-Stuart

Francisco Magdaleno Arceo

unread,
Dec 20, 2019, 4:58:13 PM12/20/19
to Stuart Morgan, Tom Verbeek, Desktop Embedding for Flutter
Sorry I didn't reply earlier. I had started a branch creating a platform interface for path_provider. Like Stuart says, there are a few considerations that have to be looked into first. This plugin in particular has a lot of platform specific APIs, so we need to think carefully which APIs will be shared in the main interface.

I am currently working on something else but was planning on picking this up once that is done. My goal is to federate path_provider and connectivity which currently have a macos implementation but are not federated.

--
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embe...@googlegroups.com.

Tom Verbeek

unread,
Dec 23, 2019, 9:46:05 AM12/23/19
to Desktop Embedding for Flutter


On Friday, December 20, 2019 at 10:51:10 PM UTC+1, Stuart Morgan wrote:

If this is something you're interested in, I would strongly recommend driving it yourself. There is a ton of work to do for desktop in general, and we are spread thin, so it's hard to say when we would get to this otherwise.

Thanks Stuart, I did so and created a PR here: https://github.com/flutter/plugins/pull/2436

The path_provider plugin already has a number of calls which are iOS or Android specific. These throw `UnsupportedError`s if called on an unsupported platform. Personally I think this is a reasonable way to handle this, So I did likewise in my PR.

Reply all
Reply to author
Forward
0 new messages