@@ -258,25 +258,25 @@ class PlatformDispatcher {
258258 view: _views[id],
259259 devicePixelRatio: devicePixelRatio,
260260 geometry: Rect .fromLTWH (0.0 , 0.0 , width, height),
261- viewPadding: WindowPadding ._(
261+ viewPadding: ViewPadding ._(
262262 top: viewPaddingTop,
263263 right: viewPaddingRight,
264264 bottom: viewPaddingBottom,
265265 left: viewPaddingLeft,
266266 ),
267- viewInsets: WindowPadding ._(
267+ viewInsets: ViewPadding ._(
268268 top: viewInsetTop,
269269 right: viewInsetRight,
270270 bottom: viewInsetBottom,
271271 left: viewInsetLeft,
272272 ),
273- padding: WindowPadding ._(
273+ padding: ViewPadding ._(
274274 top: math.max (0.0 , viewPaddingTop - viewInsetTop),
275275 right: math.max (0.0 , viewPaddingRight - viewInsetRight),
276276 bottom: math.max (0.0 , viewPaddingBottom - viewInsetBottom),
277277 left: math.max (0.0 , viewPaddingLeft - viewInsetLeft),
278278 ),
279- systemGestureInsets: WindowPadding ._(
279+ systemGestureInsets: ViewPadding ._(
280280 top: math.max (0.0 , systemGestureInsetTop),
281281 right: math.max (0.0 , systemGestureInsetRight),
282282 bottom: math.max (0.0 , systemGestureInsetBottom),
@@ -1335,10 +1335,10 @@ class ViewConfiguration {
13351335 this .devicePixelRatio = 1.0 ,
13361336 this .geometry = Rect .zero,
13371337 this .visible = false ,
1338- this .viewInsets = WindowPadding .zero,
1339- this .viewPadding = WindowPadding .zero,
1340- this .systemGestureInsets = WindowPadding .zero,
1341- this .padding = WindowPadding .zero,
1338+ this .viewInsets = ViewPadding .zero,
1339+ this .viewPadding = ViewPadding .zero,
1340+ this .systemGestureInsets = ViewPadding .zero,
1341+ this .padding = ViewPadding .zero,
13421342 this .gestureSettings = const GestureSettings (),
13431343 this .displayFeatures = const < DisplayFeature > [],
13441344 }) : assert (window == null || view == null ),
@@ -1356,10 +1356,10 @@ class ViewConfiguration {
13561356 double ? devicePixelRatio,
13571357 Rect ? geometry,
13581358 bool ? visible,
1359- WindowPadding ? viewInsets,
1360- WindowPadding ? viewPadding,
1361- WindowPadding ? systemGestureInsets,
1362- WindowPadding ? padding,
1359+ ViewPadding ? viewInsets,
1360+ ViewPadding ? viewPadding,
1361+ ViewPadding ? systemGestureInsets,
1362+ ViewPadding ? padding,
13631363 GestureSettings ? gestureSettings,
13641364 List <DisplayFeature >? displayFeatures,
13651365 }) {
@@ -1410,53 +1410,53 @@ class ViewConfiguration {
14101410 ///
14111411 /// For instance, if the view doesn't overlap the
14121412 /// [ScreenConfiguration.viewInsets] area, [viewInsets] will be
1413- /// [WindowPadding .zero] .
1413+ /// [ViewPadding .zero] .
14141414 ///
14151415 /// The number of physical pixels on each side of this view rectangle into
14161416 /// which the application can draw, but over which the operating system will
14171417 /// likely place system UI, such as the keyboard or system menus, that fully
14181418 /// obscures any content.
1419- final WindowPadding viewInsets;
1419+ final ViewPadding viewInsets;
14201420
14211421 /// The view insets, as it intersects with [ScreenConfiguration.viewPadding]
14221422 /// for the screen it is on.
14231423 ///
14241424 /// For instance, if the view doesn't overlap the
14251425 /// [ScreenConfiguration.viewPadding] area, [viewPadding] will be
1426- /// [WindowPadding .zero] .
1426+ /// [ViewPadding .zero] .
14271427 ///
14281428 /// The number of physical pixels on each side of this screen rectangle into
14291429 /// which the application can place a view, but which may be partially
14301430 /// obscured by system UI (such as the system notification area), or physical
14311431 /// intrusions in the display (e.g. overscan regions on television screens or
14321432 /// phone sensor housings).
1433- final WindowPadding viewPadding;
1433+ final ViewPadding viewPadding;
14341434
14351435 /// The view insets, as it intersects with
14361436 /// [ScreenConfiguration.systemGestureInsets] for the screen it is on.
14371437 ///
14381438 /// For instance, if the view doesn't overlap the
14391439 /// [ScreenConfiguration.systemGestureInsets] area, [systemGestureInsets] will
1440- /// be [WindowPadding .zero] .
1440+ /// be [ViewPadding .zero] .
14411441 ///
14421442 /// The number of physical pixels on each side of this screen rectangle into
14431443 /// which the application can place a view, but where the operating system
14441444 /// will consume input gestures for the sake of system navigation.
1445- final WindowPadding systemGestureInsets;
1445+ final ViewPadding systemGestureInsets;
14461446
14471447 /// The view insets, as it intersects with [ScreenConfiguration.padding] for
14481448 /// the screen it is on.
14491449 ///
14501450 /// For instance, if the view doesn't overlap the
14511451 /// [ScreenConfiguration.padding] area, [padding] will be
1452- /// [WindowPadding .zero] .
1452+ /// [ViewPadding .zero] .
14531453 ///
14541454 /// The number of physical pixels on each side of this screen rectangle into
14551455 /// which the application can place a view, but which may be partially
14561456 /// obscured by system UI (such as the system notification area), or physical
14571457 /// intrusions in the display (e.g. overscan regions on television screens or
14581458 /// phone sensor housings).
1459- final WindowPadding padding;
1459+ final ViewPadding padding;
14601460
14611461 /// Additional configuration for touch gestures performed on this view.
14621462 ///
@@ -1765,8 +1765,8 @@ enum AppLifecycleState {
17651765/// * [MediaQuery.of] , for the preferred mechanism for accessing these values.
17661766/// * [Scaffold] , which automatically applies the padding in material design
17671767/// applications.
1768- class WindowPadding {
1769- const WindowPadding ._({ required this .left, required this .top, required this .right, required this .bottom });
1768+ class ViewPadding {
1769+ const ViewPadding ._({ required this .left, required this .top, required this .right, required this .bottom });
17701770
17711771 /// The distance from the left edge to the first unpadded pixel, in physical pixels.
17721772 final double left;
@@ -1780,15 +1780,21 @@ class WindowPadding {
17801780 /// The distance from the bottom edge to the first unpadded pixel, in physical pixels.
17811781 final double bottom;
17821782
1783- /// A window padding that has zeros for each edge.
1784- static const WindowPadding zero = WindowPadding ._(left: 0.0 , top: 0.0 , right: 0.0 , bottom: 0.0 );
1783+ /// A view padding that has zeros for each edge.
1784+ static const ViewPadding zero = ViewPadding ._(left: 0.0 , top: 0.0 , right: 0.0 , bottom: 0.0 );
17851785
17861786 @override
17871787 String toString () {
1788- return 'WindowPadding (left: $left , top: $top , right: $right , bottom: $bottom )' ;
1788+ return 'ViewPadding (left: $left , top: $top , right: $right , bottom: $bottom )' ;
17891789 }
17901790}
17911791
1792+ /// Deprecated. Will be removed in a future version of Flutter.
1793+ ///
1794+ /// Use [ViewPadding] instead.
1795+ // TODO(goderbauer): deprecate this when framework has been migrated to ViewPadding.
1796+ typedef ViewPadding = WindowPadding ;
1797+
17921798/// Area of the display that may be obstructed by a hardware feature.
17931799///
17941800/// This is populated only on Android.
0 commit comments