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.
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.
However, in my app, my
PainterController
hasbackgroundColor = Colors.transparent
.I am not that familiar with different blend modes and if there is another way to achieve my desired result.