handleTapCancel method
- required PointerDownEvent down,
- PointerCancelEvent? cancel,
- required String reason,
override
A pointer that previously triggered handleTapDown will not end up causing a tap.
This triggers once the gesture loses the arena if handleTapDown has been previously triggered.
The parameter down
is the down event of the primary pointer that started
the tap sequence; cancel
is the cancel event, which might be null;
reason
is a short description of the cause if cancel
is null, which
can be "forced" if other gestures won the arena, or "spontaneous"
otherwise.
If this recognizer wins the arena, handleTapUp is called instead.
Implementation
@protected
@override
void handleTapCancel({ required PointerDownEvent down, PointerCancelEvent? cancel, required String reason }) {
final String note = reason == '' ? reason : '$reason ';
switch (down.buttons) {
case kPrimaryButton:
if (onTapCancel != null) {
invokeCallback<void>('${note}onTapCancel', onTapCancel!);
}
case kSecondaryButton:
if (onSecondaryTapCancel != null) {
invokeCallback<void>('${note}onSecondaryTapCancel', onSecondaryTapCancel!);
}
case kTertiaryButton:
if (onTertiaryTapCancel != null) {
invokeCallback<void>('${note}onTertiaryTapCancel', onTertiaryTapCancel!);
}
default:
}
}