@@ -222,10 +222,10 @@ class PlatformDispatcher {
222222 final ViewConfiguration previousConfiguration =
223223 _viewConfigurations[id] ?? const ViewConfiguration ();
224224 if (! _views.containsKey (id)) {
225- _views[id] = FlutterWindow ._(id, this );
225+ _views[id] = FlutterView ._(id, this );
226226 }
227227 _viewConfigurations[id] = previousConfiguration.copyWith (
228- window : _views[id],
228+ view : _views[id],
229229 devicePixelRatio: devicePixelRatio,
230230 geometry: Rect .fromLTWH (0.0 , 0.0 , width, height),
231231 viewPadding: WindowPadding ._(
@@ -1289,8 +1289,18 @@ class PlatformConfiguration {
12891289/// An immutable view configuration.
12901290class ViewConfiguration {
12911291 /// A const constructor for an immutable [ViewConfiguration] .
1292+ ///
1293+ /// When constructing a view configuration, supply either the [view] or the
1294+ /// [window] property, but not both since the [view] and [window] property
1295+ /// are backed by the same instance variable.
12921296 const ViewConfiguration ({
1293- this .window,
1297+ FlutterView ? view,
1298+ @Deprecated ('''
1299+ Use the `view` property instead.
1300+ This change is related to adding multi-view support in Flutter.
1301+ This feature was deprecated after 3.7.0-1.2.pre.
1302+ ''' )
1303+ FlutterView ? window,
12941304 this .devicePixelRatio = 1.0 ,
12951305 this .geometry = Rect .zero,
12961306 this .visible = false ,
@@ -1300,10 +1310,17 @@ class ViewConfiguration {
13001310 this .padding = WindowPadding .zero,
13011311 this .gestureSettings = const GestureSettings (),
13021312 this .displayFeatures = const < DisplayFeature > [],
1303- });
1313+ }) : assert (window == null || view == null ),
1314+ _view = view ?? window;
13041315
13051316 /// Copy this configuration with some fields replaced.
13061317 ViewConfiguration copyWith ({
1318+ FlutterView ? view,
1319+ @Deprecated ('''
1320+ Use the `view` property instead.
1321+ This change is related to adding multi-view support in Flutter.
1322+ This feature was deprecated after 3.7.0-1.2.pre.
1323+ ''' )
13071324 FlutterView ? window,
13081325 double ? devicePixelRatio,
13091326 Rect ? geometry,
@@ -1315,8 +1332,9 @@ class ViewConfiguration {
13151332 GestureSettings ? gestureSettings,
13161333 List <DisplayFeature >? displayFeatures,
13171334 }) {
1335+ assert (view == null || window == null );
13181336 return ViewConfiguration (
1319- window : window ?? this . window,
1337+ view : view ?? window ?? _view ,
13201338 devicePixelRatio: devicePixelRatio ?? this .devicePixelRatio,
13211339 geometry: geometry ?? this .geometry,
13221340 visible: visible ?? this .visible,
@@ -1329,11 +1347,22 @@ class ViewConfiguration {
13291347 );
13301348 }
13311349
1332- /// The top level view into which the view is placed and its geometry is
1333- /// relative to.
1350+ /// The top level view for which this [ViewConfiguration] 's properties apply to.
1351+ ///
1352+ /// If this property is null, this [ViewConfiguration] is a top level view.
1353+ @Deprecated ('''
1354+ Use the `view` property instead.
1355+ This change is related to adding multi-view support in Flutter.
1356+ This feature was deprecated after 3.7.0-1.2.pre.
1357+ ''' )
1358+ FlutterView ? get window => _view;
1359+
1360+ /// The top level view for which this [ViewConfiguration] 's properties apply to.
13341361 ///
1335- /// If null, then this configuration represents a top level view itself.
1336- final FlutterView ? window;
1362+ /// If this property is null, this [ViewConfiguration] is a top level view.
1363+ FlutterView ? get view => _view;
1364+
1365+ final FlutterView ? _view;
13371366
13381367 /// The pixel density of the output surface.
13391368 final double devicePixelRatio;
@@ -1427,7 +1456,7 @@ class ViewConfiguration {
14271456
14281457 @override
14291458 String toString () {
1430- return '$runtimeType [window : $window , geometry: $geometry ]' ;
1459+ return '$runtimeType [view : $view , geometry: $geometry ]' ;
14311460 }
14321461}
14331462
@@ -1666,7 +1695,7 @@ enum AppLifecycleState {
16661695 /// On Android, this corresponds to an app or the Flutter host view running
16671696 /// in the foreground inactive state. Apps transition to this state when
16681697 /// another activity is focused, such as a split-screen app, a phone call,
1669- /// a picture-in-picture app, a system dialog, or another window .
1698+ /// a picture-in-picture app, a system dialog, or another view .
16701699 ///
16711700 /// Apps in this state should assume that they may be [paused] at any time.
16721701 inactive,
0 commit comments