Skip to content

Commit 43b653e

Browse files
Add a more typical / concrete example to IntrinsicHeight / IntrinsicWidth (#152246)
The current example: > for example, when unlimited width is available and /// you would like a child that would otherwise attempt to expand infinitely to /// instead size itself to a more reasonable width. doesn't seem to be the most useful example because most leaf widgets will just size themselves to their intrinsic size if the incoming constraints are not tight, so when I was reading the doc I wasn't able to come up with any concrete widget combination that would require the use of `IntrinsicHeight`.
1 parent 033d1ad commit 43b653e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/flutter/lib/src/widgets/basic.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3406,7 +3406,9 @@ class AspectRatio extends SingleChildRenderObjectWidget {
34063406
///
34073407
/// This class is useful, for example, when unlimited width is available and
34083408
/// you would like a child that would otherwise attempt to expand infinitely to
3409-
/// instead size itself to a more reasonable width.
3409+
/// instead size itself to a more reasonable width. Additionally, putting a
3410+
/// [Column] inside an [IntrinsicWidth] will allow all [Column] children to be
3411+
/// as wide as the widest child.
34103412
///
34113413
/// The constraints that this widget passes to its child will adhere to the
34123414
/// parent's constraints, so if the constraints are not large enough to satisfy
@@ -3483,7 +3485,9 @@ class IntrinsicWidth extends SingleChildRenderObjectWidget {
34833485
///
34843486
/// This class is useful, for example, when unlimited height is available and
34853487
/// you would like a child that would otherwise attempt to expand infinitely to
3486-
/// instead size itself to a more reasonable height.
3488+
/// instead size itself to a more reasonable height. Additionally, putting a
3489+
/// [Row] inside an [IntrinsicHeight] will allow all [Row] children to be as tall
3490+
/// as the tallest child.
34873491
///
34883492
/// The constraints that this widget passes to its child will adhere to the
34893493
/// parent's constraints, so if the constraints are not large enough to satisfy

0 commit comments

Comments
 (0)