getDownloadsDirectoryPath static method

Future<String> getDownloadsDirectoryPath()

获取下载目录路径

Implementation

static Future<String> getDownloadsDirectoryPath() async {
  if (Platform.isAndroid) {
    final Directory? downloadsDir = await getExternalStorageDirectory();
    return downloadsDir!.path;
  } else {
    final Directory? downloadsDir = await getDownloadsDirectory();
    return downloadsDir!.path;
  }
}