This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -624,6 +624,8 @@ void hooksTests() async {
624624
625625 expectEquals (window.viewConfiguration.gestureSettings,
626626 GestureSettings (physicalTouchSlop: 11.0 ));
627+ expectEquals (window.gestureSettings,
628+ GestureSettings (physicalTouchSlop: 11.0 ));
627629
628630 _callHook (
629631 '_updateWindowMetrics' ,
@@ -652,6 +654,8 @@ void hooksTests() async {
652654
653655 expectEquals (window.viewConfiguration.gestureSettings,
654656 GestureSettings (physicalTouchSlop: null ));
657+ expectEquals (window.gestureSettings,
658+ GestureSettings (physicalTouchSlop: null ));
655659
656660 _callHook (
657661 '_updateWindowMetrics' ,
@@ -680,6 +684,8 @@ void hooksTests() async {
680684
681685 expectEquals (window.viewConfiguration.gestureSettings,
682686 GestureSettings (physicalTouchSlop: 22.0 ));
687+ expectEquals (window.gestureSettings,
688+ GestureSettings (physicalTouchSlop: 22.0 ));
683689 });
684690
685691 await test ('onLocaleChanged preserves callback zone' , () {
Original file line number Diff line number Diff line change @@ -226,6 +226,13 @@ class FlutterView {
226226 /// applications.
227227 ViewPadding get padding => viewConfiguration.padding;
228228
229+ /// Additional configuration for touch gestures performed on this view.
230+ ///
231+ /// For example, the touch slop defined in physical pixels may be provided
232+ /// by the gesture settings and should be preferred over the framework
233+ /// touch slop constant.
234+ GestureSettings get gestureSettings => viewConfiguration.gestureSettings;
235+
229236 /// {@macro dart.ui.ViewConfiguration.displayFeatures}
230237 ///
231238 /// When this changes, [PlatformDispatcher.onMetricsChanged] is called.
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ abstract class FlutterView {
1515 ViewPadding get viewPadding => viewConfiguration.viewPadding;
1616 ViewPadding get systemGestureInsets => viewConfiguration.systemGestureInsets;
1717 ViewPadding get padding => viewConfiguration.padding;
18+ GestureSettings get gestureSettings => viewConfiguration.gestureSettings;
1819 List <DisplayFeature > get displayFeatures => viewConfiguration.displayFeatures;
1920 void render (Scene scene) => platformDispatcher.render (scene, this );
2021 void updateSemantics (SemanticsUpdate update) => platformDispatcher.updateSemantics (update);
You can’t perform that action at this time.
0 commit comments