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
ef803a2b
Unverified
Commit
ef803a2b
authored
Feb 11, 2022
by
Jonah Williams
Committed by
GitHub
Feb 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[framework] use platform touchslop on Android (#97971)
parent
38ea38a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+7
-2
media_query_test.dart
packages/flutter/test/widgets/media_query_test.dart
+10
-1
No files found.
packages/flutter/lib/src/widgets/scrollable.dart
View file @
ef803a2b
...
...
@@ -15,6 +15,7 @@ import 'basic.dart';
import
'focus_manager.dart'
;
import
'framework.dart'
;
import
'gesture_detector.dart'
;
import
'media_query.dart'
;
import
'notification_listener.dart'
;
import
'primary_scroll_controller.dart'
;
import
'restoration.dart'
;
...
...
@@ -399,6 +400,7 @@ class ScrollableState extends State<Scrollable> with TickerProviderStateMixin, R
late
ScrollBehavior
_configuration
;
ScrollPhysics
?
_physics
;
ScrollController
?
_fallbackScrollController
;
MediaQueryData
?
_mediaQueryData
;
ScrollController
get
_effectiveScrollController
=>
widget
.
controller
??
_fallbackScrollController
!;
...
...
@@ -452,6 +454,7 @@ class ScrollableState extends State<Scrollable> with TickerProviderStateMixin, R
@override
void
didChangeDependencies
()
{
_mediaQueryData
=
MediaQuery
.
maybeOf
(
context
);
_updatePosition
();
super
.
didChangeDependencies
();
}
...
...
@@ -565,7 +568,8 @@ class ScrollableState extends State<Scrollable> with TickerProviderStateMixin, R
..
minFlingVelocity
=
_physics
?.
minFlingVelocity
..
maxFlingVelocity
=
_physics
?.
maxFlingVelocity
..
velocityTrackerBuilder
=
_configuration
.
velocityTrackerBuilder
(
context
)
..
dragStartBehavior
=
widget
.
dragStartBehavior
;
..
dragStartBehavior
=
widget
.
dragStartBehavior
..
gestureSettings
=
_mediaQueryData
?.
gestureSettings
;
},
),
};
...
...
@@ -585,7 +589,8 @@ class ScrollableState extends State<Scrollable> with TickerProviderStateMixin, R
..
minFlingVelocity
=
_physics
?.
minFlingVelocity
..
maxFlingVelocity
=
_physics
?.
maxFlingVelocity
..
velocityTrackerBuilder
=
_configuration
.
velocityTrackerBuilder
(
context
)
..
dragStartBehavior
=
widget
.
dragStartBehavior
;
..
dragStartBehavior
=
widget
.
dragStartBehavior
..
gestureSettings
=
_mediaQueryData
?.
gestureSettings
;
},
),
};
...
...
packages/flutter/test/widgets/media_query_test.dart
View file @
ef803a2b
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
show
Brightness
,
DisplayFeature
,
DisplayFeatureState
,
DisplayFeatureType
;
import
'dart:ui'
show
Brightness
,
DisplayFeature
,
DisplayFeatureState
,
DisplayFeatureType
,
GestureSettings
,
ViewConfiguration
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
@@ -914,4 +914,13 @@ void main() {
expect
(
subScreenMediaQuery
.
highContrast
,
true
);
expect
(
subScreenMediaQuery
.
displayFeatures
,
<
DisplayFeature
>[
cutoutDisplayFeature
]);
});
testWidgets
(
'MediaQuery.enableDeviceGestureSettings allows disabling gesture settings'
,
(
WidgetTester
tester
)
async
{
tester
.
binding
.
window
.
viewConfigurationTestValue
=
const
ViewConfiguration
(
gestureSettings:
GestureSettings
(
physicalDoubleTapSlop:
100
,
physicalTouchSlop:
100
),
);
expect
(
MediaQueryData
.
fromWindow
(
tester
.
binding
.
window
).
gestureSettings
.
touchSlop
,
closeTo
(
33.33
,
0.1
));
// Repeating, of course
tester
.
binding
.
window
.
viewConfigurationTestValue
=
null
;
});
}
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