You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The widget constructor for PageListViewportGestures accepts an argument called deviceKind. We expect that when stylus is added as a device, the user wil be able to use it to scroll. However, even after providing stylus as one of the device kinds the widget does not recognize gestures made with a stylus.
To confirm our findings, we created a test called operates as a panning device. In it, we fling with a stylus, expecting the velocity to update, but it never does.
//Add stylus to PageListViewPortGesturesfinal deviceKind = {
PointerDeviceKind.mouse,
PointerDeviceKind.trackpad,
PointerDeviceKind.touch,
PointerDeviceKind.stylus,
};
await_pumpPageListViewport(widgetTester, controller: controller, pointerDevices: deviceKind);
Offset? latestVelocity;
controller.addListener(() {
latestVelocity = controller.velocity;
});
// Fling up with stylusawait widgetTester.fling(find.byType(Scaffold), constOffset(0, -500), 4000,
deviceKind:PointerDeviceKind.stylus);
// The viewport is moving after flingawait widgetTester.pump();
expect(latestVelocity, isNotNull);
It looks like there is a slight issue with the control flow, intentionally preventing gestures with a stylus.
Despite stylus not being fully supported as a device, we observe that an already scrolling viewport can in practice be stopped with a stylus. Reproducing it in a test, we observe that on stylus down the viewport does not halt immediately (after a pump). Here is the full test. However, we notice that if we pump four times, the viewport action stops.
// Fling up, to scroll down, and run a panning simulation.await widgetTester.fling(find.byType(Scaffold), constOffset(0, -500), 4000);
// The viewport is movingawait widgetTester.pump();
expect(latestVelocity ==Offset.zero, false);
await widgetTester.startGesture(constOffset(0, 0), kind:PointerDeviceKind.stylus);
// Pumping one frame does not suffice to propagate the stylus gesture// and stop the scrolling simulation, so we're using a pumping duration.await widgetTester.pump();
expect(latestVelocity ==Offset.zero, true); // Fails
It looks like stopMomentum() is not properly stopping the viewport controller.
The text was updated successfully, but these errors were encountered:
The widget constructor for
PageListViewportGestures
accepts an argument calleddeviceKind
. We expect that when stylus is added as a device, the user wil be able to use it to scroll. However, even after providing stylus as one of the device kinds the widget does not recognize gestures made with a stylus.To confirm our findings, we created a test called operates as a panning device. In it, we fling with a stylus, expecting the velocity to update, but it never does.
It looks like there is a slight issue with the control flow, intentionally preventing gestures with a stylus.
Despite stylus not being fully supported as a device, we observe that an already scrolling viewport can in practice be stopped with a stylus. Reproducing it in a test, we observe that on stylus down the viewport does not halt immediately (after a pump). Here is the full test. However, we notice that if we pump four times, the viewport action stops.
It looks like
stopMomentum()
is not properly stopping the viewport controller.The text was updated successfully, but these errors were encountered: