checkConsecutive method

void checkConsecutive(
  1. int pointer
)

Check if the long-tap gesture is currently can be consecutive.

Implementation

void checkConsecutive(int pointer) {
  onLongTapAccept.call();
  if (onLongTap.call(count)) {
    // If the [count] is 0, it means the first consecutive cycle, Therefore calls
    // the lifecycle callback function that is called when consecutive gesture started.
    if (count == 0) onLongTapStart?.call();

    count += 1;
    onConsecutive(pointer);
  } else {
    // If the current is consecutive status, Need to separately calls the
    // lifecycle callback function that is called when consecutive gesture ended.
    if (isConsecutive) onLongTapEnd?.call();

    didStopTrackingLastPointer(pointer);
    ensureFocusEnd();
  }
}