@@ -1912,9 +1912,9 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
1912
1912
1913
1913
@override
1914
1914
ViewConfiguration createViewConfiguration () {
1915
- return TestViewConfiguration (
1915
+ return TestViewConfiguration . fromView (
1916
1916
size: _surfaceSize ?? _kDefaultTestViewportSize,
1917
- window : window,
1917
+ view : window,
1918
1918
);
1919
1919
}
1920
1920
@@ -1938,20 +1938,31 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
1938
1938
/// size is in logical pixels. The resulting ViewConfiguration maps the given
1939
1939
/// size onto the actual display using the [BoxFit.contain] algorithm.
1940
1940
class TestViewConfiguration extends ViewConfiguration {
1941
- /// Creates a [TestViewConfiguration] with the given size. Defaults to 800x600.
1941
+ /// Deprecated. Will be removed in a future version of Flutter.
1942
+ ///
1943
+ /// This property has been deprecated to prepare for Flutter's upcoming
1944
+ /// support for multiple views and multiple windows.
1942
1945
///
1943
- /// If a [window] instance is not provided it defaults to [ui.window] .
1946
+ /// Use [TestViewConfiguration.fromView] instead.
1947
+ @Deprecated (
1948
+ 'Use TestViewConfiguration.fromView instead. '
1949
+ 'Deprecated to prepare for the upcoming multi-window support. '
1950
+ 'This feature was deprecated after v3.7.0-32.0.pre.'
1951
+ )
1944
1952
factory TestViewConfiguration ({
1945
1953
Size size = _kDefaultTestViewportSize,
1946
1954
ui.FlutterView ? window,
1947
1955
}) {
1948
- return TestViewConfiguration ._ (size, window ?? ui.window);
1956
+ return TestViewConfiguration .fromView (size: size, view : window ?? ui.window);
1949
1957
}
1950
1958
1951
- TestViewConfiguration ._(Size size, ui.FlutterView window)
1952
- : _paintMatrix = _getMatrix (size, window.devicePixelRatio, window),
1953
- _hitTestMatrix = _getMatrix (size, 1.0 , window),
1954
- super (size: size, devicePixelRatio: window.devicePixelRatio);
1959
+ /// Creates a [TestViewConfiguration] with the given size and view.
1960
+ ///
1961
+ /// The [size] defaults to 800x600.
1962
+ TestViewConfiguration .fromView ({required ui.FlutterView view, super .size = _kDefaultTestViewportSize})
1963
+ : _paintMatrix = _getMatrix (size, view.devicePixelRatio, view),
1964
+ _hitTestMatrix = _getMatrix (size, 1.0 , view),
1965
+ super (devicePixelRatio: view.devicePixelRatio);
1955
1966
1956
1967
static Matrix4 _getMatrix (Size size, double devicePixelRatio, ui.FlutterView window) {
1957
1968
final double inverseRatio = devicePixelRatio / window.devicePixelRatio;
0 commit comments