screenshot icon indicating copy to clipboard operation
screenshot copied to clipboard

Web:Unsupported operation: toImage is not supported on the Web

Open Patrick386 opened this issue 3 years ago • 8 comments

Flutter Web: flutter 2.2.3, Dart 2.13.4

I tested it with the sample source. Do you support the web?

Patrick386 avatar Jul 17 '21 06:07 Patrick386

I tested it in my web app, and it's working fine!

NickKoroloff avatar Jul 22 '21 14:07 NickKoroloff

I tested it in my web app, and it's working fine!

I've found that it only works if you are using the CanvasKit renderer. If you try to use the HTML renderer it does not work.

roberteverman avatar Aug 01 '21 08:08 roberteverman

I tested it in my web app, and it's working fine!

I've found that it only works if you are using the CanvasKit renderer. If you try to use the HTML renderer it does not work.

Yes, it works with CanvasKit renderer, just use this syntax bellow for compiling : flutter build web --web-renderer canvaskit you can close this issue.

c26ranto avatar Aug 31 '21 01:08 c26ranto

I don't think it should close the issue, because some people like me need to use HTML renderer in the app in order for other things to work properly.

hyungtaecf avatar Sep 16 '21 04:09 hyungtaecf

image remove --web-renderer=html

its fixed for me

denyocrworld avatar Dec 02 '21 07:12 denyocrworld

I suppose this can be closed in favor of #82

bw-flagship avatar Apr 18 '22 09:04 bw-flagship

In the HTML render, Have any function using instead toImage()? I need to use toImage() or some function can do like this. I have many issues when I am using the canvaskit renderer. Please fix it or create a new function for the HTML render.

SittiphanSittisak avatar May 18 '22 10:05 SittiphanSittisak

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 image

karlreginaldo avatar Jan 09 '24 17:01 karlreginaldo