@@ -229,6 +229,9 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox {
229229 /// Initializes member variables for subclasses.
230230 ///
231231 /// The [alignment] argument must not be null.
232+ ///
233+ /// The [textDirection] must be non-null if the [alignment] is
234+ /// direction-sensitive.
232235 RenderAligningShiftedBox ({
233236 AlignmentGeometry alignment = Alignment .center,
234237 @required TextDirection textDirection,
@@ -303,6 +306,7 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox {
303306 ///
304307 /// This method must be called after the child has been laid out and
305308 /// this object's own size has been set.
309+ @protected
306310 void alignChild () {
307311 _resolve ();
308312 assert (child != null );
@@ -707,6 +711,9 @@ class RenderUnconstrainedBox extends RenderAligningShiftedBox with DebugOverflow
707711/// A render object that is a specific size but passes its original constraints
708712/// through to its child, which it allows to overflow.
709713///
714+ /// If the child's resulting size differs from this render object's size, then
715+ /// the child is aligned according to the [alignment] property.
716+ ///
710717/// See also:
711718/// * [RenderUnconstrainedBox] for a render object that allows its children
712719/// to render themselves unconstrained, expands to fit them, and considers
@@ -717,11 +724,14 @@ class RenderUnconstrainedBox extends RenderAligningShiftedBox with DebugOverflow
717724class RenderSizedOverflowBox extends RenderAligningShiftedBox {
718725 /// Creates a render box of a given size that lets its child overflow.
719726 ///
720- /// The [requestedSize] argument must not be null.
727+ /// The [requestedSize] and [alignment] arguments must not be null.
728+ ///
729+ /// The [textDirection] argument must not be null if the [alignment] is
730+ /// direction-sensitive.
721731 RenderSizedOverflowBox ({
722732 RenderBox child,
723733 @required Size requestedSize,
724- Alignment alignment = Alignment .center,
734+ AlignmentGeometry alignment = Alignment .center,
725735 TextDirection textDirection,
726736 }) : assert (requestedSize != null ),
727737 _requestedSize = requestedSize,
@@ -769,7 +779,7 @@ class RenderSizedOverflowBox extends RenderAligningShiftedBox {
769779 void performLayout () {
770780 size = constraints.constrain (_requestedSize);
771781 if (child != null ) {
772- child.layout (constraints);
782+ child.layout (constraints, parentUsesSize : true );
773783 alignChild ();
774784 }
775785 }
@@ -783,17 +793,24 @@ class RenderSizedOverflowBox extends RenderAligningShiftedBox {
783793/// for a given axis is null, then the constraints from the parent are just
784794/// passed through instead.
785795///
786- /// It then tries to size itself to the size of its child.
796+ /// It then tries to size itself to the size of its child. Where this is not
797+ /// possible (e.g. if the constraints from the parent are themselves tight), the
798+ /// child is aligned according to [alignment] .
787799class RenderFractionallySizedOverflowBox extends RenderAligningShiftedBox {
788800 /// Creates a render box that sizes its child to a fraction of the total available space.
789801 ///
790802 /// If non-null, the [widthFactor] and [heightFactor] arguments must be
791803 /// non-negative.
804+ ///
805+ /// The [alignment] must not be null.
806+ ///
807+ /// The [textDirection] must be non-null if the [alignment] is
808+ /// direction-sensitive.
792809 RenderFractionallySizedOverflowBox ({
793810 RenderBox child,
794811 double widthFactor,
795812 double heightFactor,
796- Alignment alignment = Alignment .center,
813+ AlignmentGeometry alignment = Alignment .center,
797814 TextDirection textDirection,
798815 }) : _widthFactor = widthFactor,
799816 _heightFactor = heightFactor,
0 commit comments