painter
painter copied to clipboard
Disable Multi-Touch | While moving two fingers on canvas painting gets destroyed.
I'm facing the issue while accidentally second finger touch the canvas then drawing gets distracted.
@EPNW It's recommended feature to add supports of Disable Multi-Touch while drawing.
Can anyone have an idea about it?
Thanks in advance :)
@fluttercommunity
I have the same problem, is there a good solution?
One way to do it is to wrap Painter in a Listener widget.
int _pointers = 0;
// will detect the number of fingers touching the widget
Listener(
onPointerDown: (event) {
if (!mounted) return;
setState(() {
_pointers++;
});
},
onPointerUp: (event) {
if (!mounted) return;
setState(() {
_pointers--;
});
},
child: IgnorePointer(
ignoring: _pointers > 1,
child: _pointers > 1 ? null : Painter(_paintController!),
),
),