I need to take a screenshot of WebView from webview_flutter, but it doesn't work.
I have an app which has to take a screenshot of WebView and then process it. I tried to do it using Screenshot package. I found this information https://github.com/fluttercommunity/flutter_webview_plugin/issues/181#issuecomment-497625384
From the link, I learned that it's impossible to do it through the Screenshot plugin.
Screenshot(
controller: _screenshotController,
child: WebView(
initialUrl: widget._webUrl,
onWebViewCreated:
(WebViewController webViewController) {
if (_controller.isCompleted == false)
_controller.complete(webViewController);
},
),
);
void takeScreenshot() {
_screenshotController.capture().then(
(File image) async {
_screenshot = image;
}
);
When I take the screenshot I got transparent png image, whereas I would like to have capture of the WebView content