getLastPickedDirectory method
- MediaType type
Returns the last navigated directory the user used for picking a file for a certain media type.
Implementation
Directory? getLastPickedDirectory(MediaType type) {
String path = _preferences.get('${type.uniqueKey}/last_picked_file',
defaultValue: '');
if (path.isEmpty) {
return null;
}
Directory directory = Directory(path);
if (!directory.existsSync()) {
return null;
}
return directory;
}