Home > database >  Flutter Web - Save ui.Image to png File
Flutter Web - Save ui.Image to png File

Time:08-13

I need some help with my code, I use the

"FilePicker.platform.saveFile()"

function to get the path on Windows Version (but not works on Web) and then

"final imageFuture = await controller
          .renderImage(backgroundImageSize)
          .then<Uint8List?>((ui.Image image) => image.pngBytes);
final imgFile = File(path);
imgFile.writeAsBytesSync(imageFuture!);
"

to save my image to disk, this works perfectly on Windows, but not on the web version.
I need an alternative to save ui.Image (web Version) to PNG File on disk.

  • Related