Skip to content
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

DirectoryLocation custom class #46

Open
panalgin opened this issue Apr 28, 2023 · 1 comment
Open

DirectoryLocation custom class #46

panalgin opened this issue Apr 28, 2023 · 1 comment

Comments

@panalgin
Copy link

panalgin commented Apr 28, 2023

Hello,

How can we instantiniate DirectoryLocation object? Because I would like to manually set a location if the user does not select a folder to save to. In this case, I can't seem to find a constructor function for DirectoryLocation and it is not castable from "Directory" class of dart:io

DirectoryLocation? pickedDirectory =
        await FlutterFileDialog.pickDirectory();

    pickedDirectory ??=
        (await getApplicationDocumentsDirectory()) as DirectoryLocation;

The above cast does not work

@Doflatango
Copy link
Contributor

Hi @panalgin , DirectoryLocation may contain temporary permission information granted by the user with a specific directory, therefore, there is no way to constructs a DirectoryLocation without interacting with the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants