screenshot
screenshot copied to clipboard
Unsupported operation: toImage is not supported on the Web
There are some scenarios where html engine must be used. For example, in WeChat. Have you considered adding html2canvas to make screenshots support web?
I have the same problem, on some Android devices it works on some not? Very strange :-/
I openede an issue in the flutter repo to propose support toImage on html renderer https://github.com/flutter/flutter/issues/102636
So, I've had this problem for a while, and my co-worker solved it.
Go to web/index.html
Then, find the ### onEntrypointLoaded
Change it to this:
onEntrypointLoaded: async (engineInitializer) => {
const config = { renderer: "canvaskit" };
const appRunner = await engineInitializer.initializeEngine(config);
await appRunner.runApp();
}
The reason it works on PC/laptop is that it's set to canvaskit by default, but on the phone, it's not because it's set to auto. The reference is below.
https://docs.flutter.dev/platform-integration/web/renderers
Ok but what to do if i need to use the html renderer????