I am actually trying to convert an image picked by ImagePicker in flutter to base64 image. I am always getting the error.
FileSyst
hi I just changed my code as follows,
List imageBytes = widget.fileData.readAsBytesSync();
print(imageBytes);
String base64Image = base64Encode(imageBytes);
and this is working fine now.
It is better to read it asynchronously as the image can be very large which may cause blocking of main thread
List imageBytes = await widget.fileData.readAsBytes();