Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/ui/fixtures/ui_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ void hooksTests() async {

expectEquals(window.viewConfiguration.gestureSettings,
GestureSettings(physicalTouchSlop: 11.0));
expectEquals(window.gestureSettings,
GestureSettings(physicalTouchSlop: 11.0));

_callHook(
'_updateWindowMetrics',
Expand Down Expand Up @@ -652,6 +654,8 @@ void hooksTests() async {

expectEquals(window.viewConfiguration.gestureSettings,
GestureSettings(physicalTouchSlop: null));
expectEquals(window.gestureSettings,
GestureSettings(physicalTouchSlop: null));

_callHook(
'_updateWindowMetrics',
Expand Down Expand Up @@ -680,6 +684,8 @@ void hooksTests() async {

expectEquals(window.viewConfiguration.gestureSettings,
GestureSettings(physicalTouchSlop: 22.0));
expectEquals(window.gestureSettings,
GestureSettings(physicalTouchSlop: 22.0));
});

await test('onLocaleChanged preserves callback zone', () {
Expand Down
7 changes: 7 additions & 0 deletions lib/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ class FlutterView {
/// applications.
ViewPadding get padding => viewConfiguration.padding;

/// Additional configuration for touch gestures performed on this view.
///
/// For example, the touch slop defined in physical pixels may be provided
/// by the gesture settings and should be preferred over the framework
/// touch slop constant.
GestureSettings get gestureSettings => viewConfiguration.gestureSettings;

/// {@macro dart.ui.ViewConfiguration.displayFeatures}
///
/// When this changes, [PlatformDispatcher.onMetricsChanged] is called.
Expand Down
1 change: 1 addition & 0 deletions lib/web_ui/lib/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ abstract class FlutterView {
ViewPadding get viewPadding => viewConfiguration.viewPadding;
ViewPadding get systemGestureInsets => viewConfiguration.systemGestureInsets;
ViewPadding get padding => viewConfiguration.padding;
GestureSettings get gestureSettings => viewConfiguration.gestureSettings;
List<DisplayFeature> get displayFeatures => viewConfiguration.displayFeatures;
void render(Scene scene) => platformDispatcher.render(scene, this);
void updateSemantics(SemanticsUpdate update) => platformDispatcher.updateSemantics(update);
Expand Down