onPointerUp method

  1. @override
void onPointerUp(
  1. PointerUpEvent event
)
override

Implementation

@override
void onPointerUp(PointerUpEvent event) {
  super.onPointerUp(event);

  if (++tapCount >= 2) {
    assert(_rejectTimer != null, "In the correct, double taps cannot occur without the reject timer is not exists.");
    assert(_rejectTimer!.isActive || isFocusActive, "In the correct, double taps cannot occur without the reject timer is active.");
    _rejectTimer?.cancel();

    if (onDoubleTap(originOffset, count++)) {
      // Calls the likecycle callback function that is called when started.
      if (tapCount == 2) {
        focusStart();
      }

      _aliveTimer?.cancel();
      _aliveTimer = Timer(aliveDuration, accept);
      return;
    }

    this.accept();
  } else {
    _rejectTimer ??= Timer(acceptableDuration, reject);
  }
}