getStoragePath static method

String? getStoragePath({
  1. String? category,
  2. String? fileName,
  3. String? format,
})

get External Storage Directory file path. category 分类,例如:video,image等等 fileName 文件名 format 文件格式,如果文件名包含格式,则不需要 String path = DirectoryUtil.getStoragePath(category: 'Download', fileName: 'demo.apk'; String path = DirectoryUtil.getStoragePath(category: 'Download', fileName: 'demo', format: 'apk'); Android: /storage/emulated/0/Android/data/com.thl.flustars_example/files/Download/demo.apk iOS: xxx;

Implementation

static String? getStoragePath(
    {String? category, String? fileName, String? format}) {
  return getPath(
    _storageDir,
    category: category,
    fileName: fileName,
    format: format,
  );
}