This reverts commit baa45a1718e732d0df317766f879f3e7d1b8de2a.
This commit is contained in:
parent
da6ef3eb31
commit
8f2aaa99ab
@ -19,6 +19,9 @@ 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].
|
||||
|
@ -134,6 +134,7 @@ void main() {
|
||||
PointerDeviceKind.touch,
|
||||
PointerDeviceKind.stylus,
|
||||
PointerDeviceKind.invertedStylus,
|
||||
PointerDeviceKind.unknown,
|
||||
});
|
||||
|
||||
// Use copyWith to modify drag devices
|
||||
|
@ -1273,6 +1273,35 @@ 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user