I copied some code from the web and I had these lines
File image;
...
image.writeAsBytesSync(result);
But I had to change image type to XFile. Is there a way to do the same operation with XFile class?
CodePudding user response:
A simple work-around like this will work:
XFile image;
...
File file = File(image.path);
file.writeAsBytesSync(result);
image = XFile(file.path);