Skip to content

Commit 1a089f0

Browse files
authored
Restore pan device selection, introduced in 3b86925 (Resolves #21) (#22)
1 parent 6ecde6a commit 1a089f0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/src/page_list_viewport_gestures.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ class PageListViewportGestures extends StatefulWidget {
2222
this.onDoubleTap,
2323
this.onDoubleTapCancel,
2424
this.lockPanAxis = false,
25+
this.panAndZoomPointerDevices = const {
26+
PointerDeviceKind.mouse,
27+
PointerDeviceKind.trackpad,
28+
PointerDeviceKind.touch,
29+
},
2530
this.clock = const Clock(),
2631
required this.child,
2732
}) : super(key: key);
@@ -40,6 +45,10 @@ class PageListViewportGestures extends StatefulWidget {
4045
final void Function()? onDoubleTap;
4146
final void Function()? onDoubleTapCancel;
4247

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+
4352
/// Whether the user should be locked into horizontal or vertical scrolling,
4453
/// when the user pans roughly in those directions.
4554
///
@@ -305,6 +314,7 @@ class _PageListViewportGesturesState extends State<PageListViewportGestures> wit
305314
onScaleStart: _onScaleStart,
306315
onScaleUpdate: _onScaleUpdate,
307316
onScaleEnd: _onScaleEnd,
317+
supportedDevices: widget.panAndZoomPointerDevices,
308318
child: widget.child,
309319
),
310320
);

0 commit comments

Comments
 (0)