@@ -79,7 +79,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
79
79
80
80
// This part of the layout has the same effect as putting the app bar and
81
81
// body in a column and making the body flexible. What's different is that
82
- // in this case the app bar appears -after- the body in the stacking order,
82
+ // in this case the app bar appears _after_ the body in the stacking order,
83
83
// so the app bar's shadow is drawn on top of the body.
84
84
85
85
final BoxConstraints fullWidthConstraints = looseConstraints.tighten (width: size.width);
@@ -108,7 +108,10 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
108
108
109
109
if (hasChild (_ScaffoldSlot .body)) {
110
110
final double bodyHeight = contentBottom - contentTop;
111
- final BoxConstraints bodyConstraints = fullWidthConstraints.tighten (height: bodyHeight);
111
+ final BoxConstraints bodyConstraints = new BoxConstraints (
112
+ maxWidth: fullWidthConstraints.maxWidth,
113
+ maxHeight: bodyHeight,
114
+ );
112
115
layoutChild (_ScaffoldSlot .body, bodyConstraints);
113
116
positionChild (_ScaffoldSlot .body, new Offset (0.0 , contentTop));
114
117
}
@@ -325,22 +328,20 @@ class Scaffold extends StatefulWidget {
325
328
/// [drawer] . To avoid the body being resized to avoid the window padding
326
329
/// (e.g., from the onscreen keyboard), see [resizeToAvoidBottomPadding] .
327
330
///
328
- /// The widget in the body of the scaffold will be forced to the size of the
329
- /// available space, to cover the entire scaffold other than any app bars,
330
- /// footer buttons, or navigation bars.
331
- ///
332
- /// To center this widget instead, consider putting it in a [Center] widget
333
- /// and having that be the body.
331
+ /// The widget in the body of the scaffold is positioned at the top-left of
332
+ /// the available space between the app bar and the bottom of the scaffold. To
333
+ /// center this widget instead, consider putting it in a [Center] widget and
334
+ /// having that be the body.
334
335
///
335
336
/// If you have a column of widgets that should normally fit on the screen,
336
337
/// but may overflow and would in such cases need to scroll, consider using a
337
338
/// [Block] as the body of the scaffold.
338
339
///
339
- /// If you have a list of items, consider using a [LazyBlock] or
340
- /// [LazyScrollableList] as the body of the scaffold.
340
+ /// If you have a list of items, consider using a [LazyBlock] ,
341
+ /// [LazyScrollableList] , or [MaterialList] as the body of the scaffold.
341
342
final Widget body;
342
343
343
- /// A button displayed on top of the body.
344
+ /// A button displayed on top of the [ body] .
344
345
///
345
346
/// Typically a [FloatingActionButton] .
346
347
final Widget floatingActionButton;
@@ -357,7 +358,7 @@ class Scaffold extends StatefulWidget {
357
358
/// * <https://material.google.com/components/buttons.html#buttons-persistent-footer-buttons>
358
359
final List <Widget > persistentFooterButtons;
359
360
360
- /// A panel displayed to the side of the body, often hidden on mobile devices.
361
+ /// A panel displayed to the side of the [ body] , often hidden on mobile devices.
361
362
///
362
363
/// Typically a [Drawer] .
363
364
final Widget drawer;
0 commit comments