getAppExternalStoragePaths static method

Future<List<String>> getAppExternalStoragePaths({
  1. StorageDirectoryType? type,
})

Android外部存储-特定类型文件的路径

Implementation

static Future<List<String>> getAppExternalStoragePaths({StorageDirectoryType? type}) async {
  // 如果不是Android系统,则返回空字符串
  if (!_isAndroid) return [];
  List<Directory>? list = await getExternalStorageDirectories(type: _transformDirectoryType(type));
  return list?.map((d) => d.path).toList() ?? [];
}