I have saved images as FileImage
in my docs. i want to upload them to firebase storage. But it throws the error that type String can not be converted into type File.
here is my code.
String localImage = gg['path1']['path2']['path3'];//this is actually a fileimage inform of a string
File ll = File(localImage);
String downloadUrl = await FirebaseStorageHelper()
.uploadImageAndGetDownloadUrl(
image: ll, uid: FirebaseAuth.instance.currentUser.uid);
}
Update, i tried this code. But it throws existsSync
Error
FileImage localImage =
FileImage(io.File(gg['path1']['path2]['path3']));
print(localImage.file.absolute.existsSync());
Please help, I couldn't find anything useful on google