@@ -22,6 +22,11 @@ class PageListViewportGestures extends StatefulWidget {
22
22
this .onDoubleTap,
23
23
this .onDoubleTapCancel,
24
24
this .lockPanAxis = false ,
25
+ this .panAndZoomPointerDevices = const {
26
+ PointerDeviceKind .mouse,
27
+ PointerDeviceKind .trackpad,
28
+ PointerDeviceKind .touch,
29
+ },
25
30
this .clock = const Clock (),
26
31
required this .child,
27
32
}) : super (key: key);
@@ -40,6 +45,10 @@ class PageListViewportGestures extends StatefulWidget {
40
45
final void Function ()? onDoubleTap;
41
46
final void Function ()? onDoubleTapCancel;
42
47
48
+ /// The set of [PointerDeviceKind] the gesture detector should detect.
49
+ /// Any pointers not defined within the set will be ignored.
50
+ final Set <PointerDeviceKind > panAndZoomPointerDevices;
51
+
43
52
/// Whether the user should be locked into horizontal or vertical scrolling,
44
53
/// when the user pans roughly in those directions.
45
54
///
@@ -305,6 +314,7 @@ class _PageListViewportGesturesState extends State<PageListViewportGestures> wit
305
314
onScaleStart: _onScaleStart,
306
315
onScaleUpdate: _onScaleUpdate,
307
316
onScaleEnd: _onScaleEnd,
317
+ supportedDevices: widget.panAndZoomPointerDevices,
308
318
child: widget.child,
309
319
),
310
320
);
0 commit comments