gestureRecognizers property

Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers
final

Which gestures should be forwarded to the PlatformView.

The gesture recognizers built by factories in this set participate in the gesture arena for each pointer that was put down on the widget. If any of these recognizers win the gesture arena, the entire pointer event sequence starting from the pointer down event will be dispatched to the platform view.

When null, an empty set of gesture recognizer factories is used, in which case a pointer event sequence will only be dispatched to the platform view if no other member of the arena claimed it.

For example, with the following setup vertical drags will not be dispatched to the platform view as the vertical drag gesture is claimed by the parent GestureDetector.

GestureDetector(
  onVerticalDragStart: (DragStartDetails details) {},
  child: PlatformViewSurface(
  ),
)

To get the PlatformViewSurface to claim the vertical drag gestures we can pass a vertical drag gesture recognizer factory in gestureRecognizers e.g:

GestureDetector(
  onVerticalDragStart: (DragStartDetails details) {},
  child: SizedBox(
    width: 200.0,
    height: 100.0,
    child: PlatformViewSurface(
      gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
        new Factory<OneSequenceGestureRecognizer>(
          () => new EagerGestureRecognizer(),
        ),
      ].toSet(),
    ),
  ),
)

Implementation

final Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers;