handleTapCancel method

  1. @protected
  2. @override
void handleTapCancel(
  1. {required PointerDownEvent down,
  2. PointerCancelEvent? cancel,
  3. required String reason}

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.


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!);