Unverified Commit 05fc29fe authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Rename DeviceGestureSettings.fromWindow to DeviceGestureSettings.fromView (#119291)

parent 4aed487c
......@@ -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
);
}
......
......@@ -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).
......
......@@ -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);
});
......@@ -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);
});
......@@ -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);
});
......@@ -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);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment