startTrackingPointer method

  1. @protected
void startTrackingPointer(
  1. int pointer,
  2. [Matrix4? transform]
)

Causes events related to the given pointer ID to be routed to this recognizer.

The pointer events are transformed according to transform and then delivered to handleEvent. The value for the transform argument is usually obtained from PointerDownEvent.transform to transform the events from the global coordinate space into the coordinate space of the event receiver. It may be null if no transformation is necessary.

Use stopTrackingPointer to remove the route added by this function.

This method also adds this recognizer (or its team if it's non-null) to the gesture arena for the specified pointer.

This is called by OneSequenceGestureRecognizer.addAllowedPointer.

Implementation

@protected
void startTrackingPointer(int pointer, [Matrix4? transform]) {
  GestureBinding.instance.pointerRouter.addRoute(pointer, handleEvent, transform);
  _trackedPointers.add(pointer);
  // TODO(goderbauer): Enable assert after recognizers properly clean up their defunct `_entries`, see https://github.com/flutter/flutter/issues/117356.
  // assert(!_entries.containsKey(pointer));
  _entries[pointer] = _addPointerToArena(pointer);
}