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