which is working fine when I open the website from any laptop, but it doesn't work when I open the website from mobile (neither android nor ios) which is very weird!
Sample of my code
RenderRepaintBoundary? boundary =
repaintGlobalKey.currentContext?.findRenderObject() as RenderRepaintBoundary?;
ui.Image? image = await boundary?.toImage(pixelRatio: 3.0);
ByteData? byteData = await image?.toByteData(format: ui.ImageByteFormat.png);
Uint8List? pngBytes = byteData?.buffer.asUint8List();
final base64data = base64Encode(pngBytes!);
final html.AnchorElement a = html.AnchorElement(href: 'data:image/png;base64,$base64data');
a.download = 'IMG.png';
a.click();
a.remove();
I'm trying to download an captured QR png image locally I need to achieve that for flutter web.
I found the solution: https://stackoverflow.com/a/67016194/11468643
which is working fine when I open the website from any laptop, but it doesn't work when I open the website from mobile (neither android nor ios) which is very weird!
Sample of my code