getDownloadPath static method

Future<String> getDownloadPath()

应用程序的下载目录路径,仅在 iOS/macOS 上支持

Implementation

static Future<String> getDownloadPath() async {
  // 如果不是iOS/macOS系统,则返回空字符串
  if (!_isIOSOrMacOS) return '';
  Directory? directory = await getDownloadsDirectory();
  return directory?.path ?? '';
}