Open g212gs opened 3 years ago
When I run the code, it works perfectly fine with the following code: [Checked in iOS and Android device and simulators/device]
// This will take screenshot of 'previewContainer' child widget and share it _takeScreenShot() async { try { RenderRepaintBoundary boundary = previewContainer.currentContext.findRenderObject(); if (boundary.debugNeedsPaint) { print("Waiting for boundary to be painted."); await Future.delayed(const Duration(milliseconds: 20)); return _takeScreenShot(); } ui.Image image = await boundary.toImage(pixelRatio: 3.0); final directory = (await getApplicationDocumentsDirectory()).path; ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png); Uint8List pngBytes = byteData.buffer.asUint8List(); await WcFlutterShare.share( sharePopupTitle: 'Screenshot', fileName: 'screenshot.png', mimeType: 'image/png', bytesOfFile: pngBytes); } on PlatformException catch (e) { print("PlatformException while taking screenshot :" + e.toString()); } catch (other) { print("Exception while taking screenshot:" + other.toString()); } }
But the same code doesn't work after creating IPA and install it on the device. - didn't check with an Android device.
I will look into it day after tomorrow
When I run the code, it works perfectly fine with the following code: [Checked in iOS and Android device and simulators/device]
But the same code doesn't work after creating IPA and install it on the device. - didn't check with an Android device.