acceptGesture method

  1. @override
void acceptGesture(
  1. int pointer
)
override

Called when this member wins the arena for the given pointer id.

Implementation

@override
void acceptGesture(int pointer) {
  if (pointer != _primaryPointer) {
    return;
  }

  _stopDeadlineTimer();

  assert(!_acceptedActivePointers.contains(pointer));
  _acceptedActivePointers.add(pointer);

  // Called when this recognizer is accepted by the [GestureArena].
  if (currentDown != null) {
    _checkTapDown(currentDown!);
  }

  _wonArenaForPrimaryPointer = true;

  // resolve(GestureDisposition.accepted) will be called when the [PointerMoveEvent]
  // has moved a sufficient global distance to be considered a drag and
  // `eagerVictoryOnDrag` is set to `true`.
  if (_start != null && eagerVictoryOnDrag) {
    assert(_dragState == _DragState.accepted);
    assert(currentUp == null);
    _acceptDrag(_start!);
  }

  // This recognizer will wait until it is the last one in the gesture arena
  // before accepting a drag when `eagerVictoryOnDrag` is set to `false`.
  if (_start != null && !eagerVictoryOnDrag) {
    assert(_dragState == _DragState.possible);
    assert(currentUp == null);
    _dragState = _DragState.accepted;
    _acceptDrag(_start!);
  }

  if (currentUp != null) {
    _checkTapUp(currentUp!);
  }
}