convertXFileToImageFile function
Implementation
ImageFile convertXFileToImageFile(dynamic xFile) {
try {
return ImageFile(
UniqueKey().toString(),
name: xFile.name,
extension: xFile.name.contains(".") ? xFile.name.split(".").last : "",
path: xFile.path,
);
} catch (e) {
throw Exception(
"The object pass in `convertXFileToImageFile` is not type XFile. Provided object is of type: `${xFile.runtimeType}`");
}
}