Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
000f4d15
Unverified
Commit
000f4d15
authored
Mar 29, 2022
by
chunhtai
Committed by
GitHub
Mar 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow unknown device kind to scroll scrollables (#100800)
parent
91bcf420
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
scroll_configuration.dart
packages/flutter/lib/src/widgets/scroll_configuration.dart
+3
-0
scroll_behavior_test.dart
packages/flutter/test/widgets/scroll_behavior_test.dart
+1
-0
scrollable_test.dart
packages/flutter/test/widgets/scrollable_test.dart
+29
-0
No files found.
packages/flutter/lib/src/widgets/scroll_configuration.dart
View file @
000f4d15
...
...
@@ -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].
...
...
packages/flutter/test/widgets/scroll_behavior_test.dart
View file @
000f4d15
...
...
@@ -134,6 +134,7 @@ void main() {
PointerDeviceKind
.
touch
,
PointerDeviceKind
.
stylus
,
PointerDeviceKind
.
invertedStylus
,
PointerDeviceKind
.
unknown
,
});
// Use copyWith to modify drag devices
...
...
packages/flutter/test/widgets/scrollable_test.dart
View file @
000f4d15
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment