[path_provider] add getApplicationSupportDirectory#1566
[path_provider] add getApplicationSupportDirectory#1566collinjackson merged 18 commits intoflutter:masterfrom
Conversation
|
It looks like the application support directory isn't automatically created. I'm debating whether to create it automagically, but perhaps it is best to just return the path. @mklim do you have any opinions? |
mklim
left a comment
There was a problem hiding this comment.
I'm debating whether to create it automagically, but perhaps it is best to just return the path.
@mklim do you have any opinions?
I think it would be nice to create it automagically on the platform side. I wouldn't want to block for two async calls through the MethodChannel and back to check if it exists and then make it if it doesn't every time though.
| /// use this directory for user data files. | ||
| /// | ||
| /// On iOS, this uses the `NSApplicationSupportDirectory` API. | ||
| /// This directory is not guaranteed to exist and you can call `createSync` to |
There was a problem hiding this comment.
nit:
| /// This directory is not guaranteed to exist and you can call `createSync` to | |
| /// This directory is not guaranteed to exist. You can call `createSync` to |
|
Review feedback addressed, PTAL |
|
@collinjackson
This works on Android and returns a path: Yet still throws an exception: |
This should have been landed as part of the previous flutter_tools PR.
Fixes flutter/flutter#13474
This allows developers to store files that aren't user-generated in the correct folder on iOS.
Also updated the documentation:
getStorageDirectoryon Android when storing user-generated content that should be visible to the user.getTemporaryDirectoryfor storing caches of files that don't need to be backed up.See https://developer.apple.com/icloud/documentation/data-storage/index.html
/cc @sroddy