diff --git a/packages/flutter/lib/rendering/box.dart b/packages/flutter/lib/rendering/box.dart index e5fde90979..de18eb53ff 100644 --- a/packages/flutter/lib/rendering/box.dart +++ b/packages/flutter/lib/rendering/box.dart @@ -319,7 +319,7 @@ abstract class RenderBox extends RenderObject { bool debugDoesMeetConstraints() { assert(constraints != null); assert(_size != null); - assert(!_size.isInfinite); + assert(!_size.isInfinite && 'See https://github.com/domokit/sky_engine/blob/master/sky/packages/sky/lib/widgets/sizing.md#user-content-unbounded-constraints' is String); bool result = constraints.contains(_size); if (!result) print("${this.runtimeType} does not meet its constraints. Constraints: $constraints, size: $_size"); diff --git a/packages/flutter/lib/rendering/flex.dart b/packages/flutter/lib/rendering/flex.dart index 5fa351144f..4e51914fa0 100644 --- a/packages/flutter/lib/rendering/flex.dart +++ b/packages/flutter/lib/rendering/flex.dart @@ -308,7 +308,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin`, and `ScrollableMixedWidgetList`). +In particular, `Block` tries to expand to fit the space available in +its cross-direction (i.e. if it's a vertically-scrolling block, it +will try to be as wide as its parent). If you nest a vertically +scrolling `Block` inside a horizontally scrolling `Block`, the inner +one will try to be as wide as possible, which is infinitely wide, +since the outer one is scrollable in that direction. + Flex ---- @@ -62,7 +81,8 @@ In unbounded constraints, they try to fit their children in that direction. In this case, you cannot set `flex` on the children to anything other than 0 (the default). In the widget hierarchy, this means that you cannot use `Flexible` when the flex box is inside -another flex box or inside a scrollable. +another flex box or inside a scrollable. If you do, you'll get an +assert that `canFlex` is not true, pointing you at this section. In the _cross_ direction, i.e. in their width for `Column` (vertical flex) and in their height for `Row` (horizontal flex), they must never