I was trying to compress the image before sending it to the server. But HEIC format images cannot be compressed using the package (flutter_image_compress). Also, I did not find a package that can convert images for Flutter Web. What other options are there?
I tried to find a way to do this without using third-party packages but couldn’t find one.
2
Answers
Since Flutter Web doesn't have a direct way to convert photos, I used the package "heic2any" for JavaScript.
Update index.html file (./web/index.html)
My HeicToJpegService code:
This code works as expected. There are no problems with it either.
In flutter web there is no direct way to do that till now. You can do it by implementing javascript in index.html or you can use server side logic to convert heic to jpeg format.