Skip to content

Commit

Permalink
Rename DeviceGestureSettings.fromWindow to DeviceGestureSettings.from…
Browse files Browse the repository at this point in the history
…View (#119291)
  • Loading branch information
goderbauer authored Jan 27, 2023
1 parent 4aed487 commit 05fc29f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions packages/flutter/lib/src/gestures/gesture_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class DeviceGestureSettings {
this.touchSlop,
});

/// Create a new [DeviceGestureSettings] from the provided [window].
factory DeviceGestureSettings.fromWindow(ui.FlutterView window) {
final double? physicalTouchSlop = window.viewConfiguration.gestureSettings.physicalTouchSlop;
/// Create a new [DeviceGestureSettings] from the provided [view].
factory DeviceGestureSettings.fromView(ui.FlutterView view) {
final double? physicalTouchSlop = view.viewConfiguration.gestureSettings.physicalTouchSlop;
return DeviceGestureSettings(
touchSlop: physicalTouchSlop == null ? null : physicalTouchSlop / window.devicePixelRatio
touchSlop: physicalTouchSlop == null ? null : physicalTouchSlop / view.devicePixelRatio
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/widgets/media_query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class MediaQueryData {
highContrast = platformData?.highContrast ?? view.platformDispatcher.accessibilityFeatures.highContrast,
alwaysUse24HourFormat = platformData?.alwaysUse24HourFormat ?? view.platformDispatcher.alwaysUse24HourFormat,
navigationMode = platformData?.navigationMode ?? NavigationMode.traditional,
gestureSettings = DeviceGestureSettings.fromWindow(view),
gestureSettings = DeviceGestureSettings.fromView(view),
displayFeatures = view.displayFeatures;

/// The size of the media in logical pixels (e.g, the size of the screen).
Expand Down
8 changes: 4 additions & 4 deletions packages/flutter/test/widgets/media_query_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void main() {
expect(data.highContrast, platformData.highContrast);
expect(data.alwaysUse24HourFormat, platformData.alwaysUse24HourFormat);
expect(data.navigationMode, platformData.navigationMode);
expect(data.gestureSettings, DeviceGestureSettings.fromWindow(view));
expect(data.gestureSettings, DeviceGestureSettings.fromView(view));
expect(data.displayFeatures, view.displayFeatures);
});

Expand Down Expand Up @@ -240,7 +240,7 @@ void main() {
expect(data.highContrast, platformDispatcher.accessibilityFeatures.highContrast);
expect(data.alwaysUse24HourFormat, platformDispatcher.alwaysUse24HourFormat);
expect(data.navigationMode, NavigationMode.traditional);
expect(data.gestureSettings, DeviceGestureSettings.fromWindow(view));
expect(data.gestureSettings, DeviceGestureSettings.fromView(view));
expect(data.displayFeatures, view.displayFeatures);
});

Expand Down Expand Up @@ -296,7 +296,7 @@ void main() {
expect(data.highContrast, platformData.highContrast);
expect(data.alwaysUse24HourFormat, platformData.alwaysUse24HourFormat);
expect(data.navigationMode, platformData.navigationMode);
expect(data.gestureSettings, DeviceGestureSettings.fromWindow(view));
expect(data.gestureSettings, DeviceGestureSettings.fromView(view));
expect(data.displayFeatures, view.displayFeatures);
});

Expand Down Expand Up @@ -354,7 +354,7 @@ void main() {
expect(data.highContrast, platformDispatcher.accessibilityFeatures.highContrast);
expect(data.alwaysUse24HourFormat, platformDispatcher.alwaysUse24HourFormat);
expect(data.navigationMode, NavigationMode.traditional);
expect(data.gestureSettings, DeviceGestureSettings.fromWindow(view));
expect(data.gestureSettings, DeviceGestureSettings.fromView(view));
expect(data.displayFeatures, view.displayFeatures);
});

Expand Down

0 comments on commit 05fc29f

Please sign in to comment.