Input cancellation - Flutter
On Flutter, be careful when using a GestureDetector
Avoid using events such as onDown
, like onTapDown
and onLongPressDown
, because users will not be able to cancel their interaction. Use onAction
events such onTap
or onLongPress
instead, because these have built-in support for cancellation.
@override
Widget build(BuildContext context) {
return new GestureDetector(
onDown: ... // Use onTap instead
);
}