flutter_file_dialog
flutter_file_dialog copied to clipboard
DirectoryLocation custom class
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
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.