Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erasing crashes app on mobile web #38

Open
theandrewmack opened this issue Jul 29, 2021 · 1 comment
Open

Erasing crashes app on mobile web #38

theandrewmack opened this issue Jul 29, 2021 · 1 comment

Comments

@theandrewmack
Copy link

theandrewmack commented Jul 29, 2021

I noticed a crash when attempting to erase in my Flutter web application only on mobile web browsers. I then tested it with the example code from pub.dev and experienced the same behavior.

It appears that paint.blendMode = BlendMode.clear; is the culprit.

One quick workaround I found is to just simulate an erase stroke by painting using the backgroundColor.

if (_eraseMode) {
  paint.blendMode = BlendMode.srcOver;
  paint.color = backgroundColor;
}

However, in my app, my PainterController has backgroundColor = Colors.transparent.

I am not that familiar with different blend modes and if there is another way to achieve my desired result.

@theandrewmack
Copy link
Author

I have recently discovered that this issue only happens with the html renderer. Manually setting --web-renderer canvaskit resolves the crash.

flutter run -d chrome --web-renderer canvaskit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant