CloudinaryFile.fromFile constructor

CloudinaryFile.fromFile(
  1. String path, {
  2. String? publicId,
  3. String? identifier,
  4. CloudinaryResourceType resourceType = CloudinaryResourceType.Auto,
  5. List<String>? tags,
  6. String? folder,
  7. Map<String, dynamic>? context,
})

Instantiate CloudinaryFile from File path

Implementation

factory CloudinaryFile.fromFile(
  String path, {
  String? publicId,
  String? identifier,
  CloudinaryResourceType resourceType = CloudinaryResourceType.Auto,
  List<String>? tags,
  String? folder,
  Map<String, dynamic>? context,
}) {
  return CloudinaryFile._(
    filePath: path,
    publicId: publicId,
    identifier: identifier ??= path.split('/').last,
    resourceType: resourceType,
    tags: tags,
    folder: folder,
    context: context,
  );
}