UserFlowFileRequirement.fromJson constructor
UserFlowFileRequirement.fromJson(
- Map<String, dynamic> json
)
Implementation
factory UserFlowFileRequirement.fromJson(Map<String, dynamic> json) => UserFlowFileRequirement(
fileKey: json["fileKey"],
label: json["label"],
allowedFileType: UFileType.values.firstWhere(
(UFileType e) => e.name == json["allowedFileType"],
orElse: () => UFileType.any,
),
maxFileSizeMB: json["maxFileSizeMB"] ?? 5,
allowedExtensions: json["allowedExtensions"] != null ? List<String>.from(json["allowedExtensions"]) : null,
isRequired: json["isRequired"] ?? true,
maxCount: json["maxCount"] ?? 1,
minCount: json["minCount"],
uploadApiEndpoint: json["uploadApiEndpoint"],
uploadMethod: json["uploadMethod"] ?? "POST",
additionalFormData: json["additionalFormData"] != null ? Map<String, String>.from(json["additionalFormData"]) : null,
compressImage: json["compressImage"] ?? false,
imageQuality: json["imageQuality"]?.toDouble(),
resizeToWidth: json["resizeToWidth"],
resizeToHeight: json["resizeToHeight"],
cropAspectRatio: json["cropAspectRatio"],
useCamera: json["useCamera"] ?? false,
deleteApiEndpoint: json["deleteApiEndpoint"],
previewUrlTemplate: json["previewUrlTemplate"],
);