@@ -258,25 +258,25 @@ class PlatformDispatcher {
258
258
view: _views[id],
259
259
devicePixelRatio: devicePixelRatio,
260
260
geometry: Rect .fromLTWH (0.0 , 0.0 , width, height),
261
- viewPadding: WindowPadding ._(
261
+ viewPadding: ViewPadding ._(
262
262
top: viewPaddingTop,
263
263
right: viewPaddingRight,
264
264
bottom: viewPaddingBottom,
265
265
left: viewPaddingLeft,
266
266
),
267
- viewInsets: WindowPadding ._(
267
+ viewInsets: ViewPadding ._(
268
268
top: viewInsetTop,
269
269
right: viewInsetRight,
270
270
bottom: viewInsetBottom,
271
271
left: viewInsetLeft,
272
272
),
273
- padding: WindowPadding ._(
273
+ padding: ViewPadding ._(
274
274
top: math.max (0.0 , viewPaddingTop - viewInsetTop),
275
275
right: math.max (0.0 , viewPaddingRight - viewInsetRight),
276
276
bottom: math.max (0.0 , viewPaddingBottom - viewInsetBottom),
277
277
left: math.max (0.0 , viewPaddingLeft - viewInsetLeft),
278
278
),
279
- systemGestureInsets: WindowPadding ._(
279
+ systemGestureInsets: ViewPadding ._(
280
280
top: math.max (0.0 , systemGestureInsetTop),
281
281
right: math.max (0.0 , systemGestureInsetRight),
282
282
bottom: math.max (0.0 , systemGestureInsetBottom),
@@ -1335,10 +1335,10 @@ class ViewConfiguration {
1335
1335
this .devicePixelRatio = 1.0 ,
1336
1336
this .geometry = Rect .zero,
1337
1337
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,
1342
1342
this .gestureSettings = const GestureSettings (),
1343
1343
this .displayFeatures = const < DisplayFeature > [],
1344
1344
}) : assert (window == null || view == null ),
@@ -1356,10 +1356,10 @@ class ViewConfiguration {
1356
1356
double ? devicePixelRatio,
1357
1357
Rect ? geometry,
1358
1358
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,
1363
1363
GestureSettings ? gestureSettings,
1364
1364
List <DisplayFeature >? displayFeatures,
1365
1365
}) {
@@ -1410,53 +1410,53 @@ class ViewConfiguration {
1410
1410
///
1411
1411
/// For instance, if the view doesn't overlap the
1412
1412
/// [ScreenConfiguration.viewInsets] area, [viewInsets] will be
1413
- /// [WindowPadding .zero] .
1413
+ /// [ViewPadding .zero] .
1414
1414
///
1415
1415
/// The number of physical pixels on each side of this view rectangle into
1416
1416
/// which the application can draw, but over which the operating system will
1417
1417
/// likely place system UI, such as the keyboard or system menus, that fully
1418
1418
/// obscures any content.
1419
- final WindowPadding viewInsets;
1419
+ final ViewPadding viewInsets;
1420
1420
1421
1421
/// The view insets, as it intersects with [ScreenConfiguration.viewPadding]
1422
1422
/// for the screen it is on.
1423
1423
///
1424
1424
/// For instance, if the view doesn't overlap the
1425
1425
/// [ScreenConfiguration.viewPadding] area, [viewPadding] will be
1426
- /// [WindowPadding .zero] .
1426
+ /// [ViewPadding .zero] .
1427
1427
///
1428
1428
/// The number of physical pixels on each side of this screen rectangle into
1429
1429
/// which the application can place a view, but which may be partially
1430
1430
/// obscured by system UI (such as the system notification area), or physical
1431
1431
/// intrusions in the display (e.g. overscan regions on television screens or
1432
1432
/// phone sensor housings).
1433
- final WindowPadding viewPadding;
1433
+ final ViewPadding viewPadding;
1434
1434
1435
1435
/// The view insets, as it intersects with
1436
1436
/// [ScreenConfiguration.systemGestureInsets] for the screen it is on.
1437
1437
///
1438
1438
/// For instance, if the view doesn't overlap the
1439
1439
/// [ScreenConfiguration.systemGestureInsets] area, [systemGestureInsets] will
1440
- /// be [WindowPadding .zero] .
1440
+ /// be [ViewPadding .zero] .
1441
1441
///
1442
1442
/// The number of physical pixels on each side of this screen rectangle into
1443
1443
/// which the application can place a view, but where the operating system
1444
1444
/// will consume input gestures for the sake of system navigation.
1445
- final WindowPadding systemGestureInsets;
1445
+ final ViewPadding systemGestureInsets;
1446
1446
1447
1447
/// The view insets, as it intersects with [ScreenConfiguration.padding] for
1448
1448
/// the screen it is on.
1449
1449
///
1450
1450
/// For instance, if the view doesn't overlap the
1451
1451
/// [ScreenConfiguration.padding] area, [padding] will be
1452
- /// [WindowPadding .zero] .
1452
+ /// [ViewPadding .zero] .
1453
1453
///
1454
1454
/// The number of physical pixels on each side of this screen rectangle into
1455
1455
/// which the application can place a view, but which may be partially
1456
1456
/// obscured by system UI (such as the system notification area), or physical
1457
1457
/// intrusions in the display (e.g. overscan regions on television screens or
1458
1458
/// phone sensor housings).
1459
- final WindowPadding padding;
1459
+ final ViewPadding padding;
1460
1460
1461
1461
/// Additional configuration for touch gestures performed on this view.
1462
1462
///
@@ -1765,8 +1765,8 @@ enum AppLifecycleState {
1765
1765
/// * [MediaQuery.of] , for the preferred mechanism for accessing these values.
1766
1766
/// * [Scaffold] , which automatically applies the padding in material design
1767
1767
/// 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 });
1770
1770
1771
1771
/// The distance from the left edge to the first unpadded pixel, in physical pixels.
1772
1772
final double left;
@@ -1780,15 +1780,21 @@ class WindowPadding {
1780
1780
/// The distance from the bottom edge to the first unpadded pixel, in physical pixels.
1781
1781
final double bottom;
1782
1782
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 );
1785
1785
1786
1786
@override
1787
1787
String toString () {
1788
- return 'WindowPadding (left: $left , top: $top , right: $right , bottom: $bottom )' ;
1788
+ return 'ViewPadding (left: $left , top: $top , right: $right , bottom: $bottom )' ;
1789
1789
}
1790
1790
}
1791
1791
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 WindowPadding = ViewPadding ;
1797
+
1792
1798
/// Area of the display that may be obstructed by a hardware feature.
1793
1799
///
1794
1800
/// This is populated only on Android.
0 commit comments