How to create a File object with File.fromUri(Uri.parse(input)) with input as a FFUploadedFile data type?

Hi! I'm trying to create a File object with the method File.fromUri(Uri.parse(uploadedImage)); where the input uploadedImage is an FFUploadedFile data type with data that comes from an image the user uploads. I'm trying to use the code below:

File file = File.fromUri(Uri.parse(uploadedImage));
final bytes = await file.readAsBytes();
final archiveFile = ArchiveFile('uploadedImages', bytes.length, bytes);

And uploadedImage, the input to the method, comes in the format: FFUploadedFile(name: 1700600326427000_0.png, bytes: 239701, height: null, width: null, blurHash: null,)

However, when I try to run the above Custom Code, I get the error message: "The argument type 'FFUploadedFile' can't be assigned to the parameter type 'String'"

How do I get File.fromUri to work with the FFUploadedFile data type.

4
2 replies