Revert "Allow unknown device kind to scroll scrollables (#100800)" (#101129)

This reverts commit 000f4d1590.
This commit is contained in:
chunhtai
2022-03-31 10:45:41 -07:00
committed by GitHub
parent 2876b09bc4
commit baa45a1718
3 changed files with 0 additions and 33 deletions

View File

@@ -19,9 +19,6 @@ const Set<PointerDeviceKind> _kTouchLikeDeviceTypes = <PointerDeviceKind>{
PointerDeviceKind.touch,
PointerDeviceKind.stylus,
PointerDeviceKind.invertedStylus,
// The VoiceAccess sends pointer events with unknown type when scrolling
// scrollables.
PointerDeviceKind.unknown,
};
/// The default overscroll indicator applied on [TargetPlatform.android].

View File

@@ -134,7 +134,6 @@ void main() {
PointerDeviceKind.touch,
PointerDeviceKind.stylus,
PointerDeviceKind.invertedStylus,
PointerDeviceKind.unknown,
});
// Use copyWith to modify drag devices

View File

@@ -1273,35 +1273,6 @@ void main() {
expect(tester.takeException(), null);
});
testWidgets('Accepts drag with unknown device kind by default', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/90912.
await tester.pumpWidget(
const MaterialApp(
home: CustomScrollView(
slivers: <Widget>[
SliverToBoxAdapter(child: SizedBox(height: 2000.0)),
],
),
)
);
final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true), kind: ui.PointerDeviceKind.unknown);
expect(getScrollOffset(tester), 0.0);
await gesture.moveBy(const Offset(0.0, -200));
await tester.pump();
await tester.pumpAndSettle();
expect(getScrollOffset(tester), 200);
await gesture.moveBy(const Offset(0.0, 200));
await tester.pump();
await tester.pumpAndSettle();
expect(getScrollOffset(tester), 0.0);
await gesture.removePointer();
await tester.pump();
}, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS, TargetPlatform.android }));
testWidgets('Does not scroll with mouse pointer drag when behavior is configured to ignore them', (WidgetTester tester) async {
await pumpTest(tester, debugDefaultTargetPlatformOverride, enableMouseDrag: false);
final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true), kind: ui.PointerDeviceKind.mouse);