downloadsDirectory static method
Static property to simply call and get the directory created from the returned path of native code
-
You can get the dirType from DownloadDirectoryTypes class
-
dirType property can work with Android device only
Directory? downloadsDirectory = await DownloadsPath.downloadsDirectory;
String? downloadsDirectoryPath = (await DownloadsPath.downloadsDirectory)?.path;
Implementation
static Future<Directory?> downloadsDirectory({String? dirType}) async {
final String? path = await _channel
.invokeMethod('getDownloadsDirectory', {'directoryType': dirType});
return path == null ? null : Directory(path);
}