Merge pull request #1427 from flutter/basic

Keep the two ConstrainedBox classes together
This commit is contained in:
Ian Hickson 2015-10-01 09:29:25 -07:00
commit 0533946b82

View File

@ -229,6 +229,21 @@ class SizedBox extends OneChildRenderObjectWidget {
} }
} }
class ConstrainedBox extends OneChildRenderObjectWidget {
ConstrainedBox({ Key key, this.constraints, Widget child })
: super(key: key, child: child) {
assert(constraints != null);
}
final BoxConstraints constraints;
RenderConstrainedBox createRenderObject() => new RenderConstrainedBox(additionalConstraints: constraints);
void updateRenderObject(RenderConstrainedBox renderObject, ConstrainedBox oldWidget) {
renderObject.additionalConstraints = constraints;
}
}
class OverflowBox extends OneChildRenderObjectWidget { class OverflowBox extends OneChildRenderObjectWidget {
OverflowBox({ Key key, this.minWidth, this.maxWidth, this.minHeight, this.maxHeight, Widget child }) OverflowBox({ Key key, this.minWidth, this.maxWidth, this.minHeight, this.maxHeight, Widget child })
: super(key: key, child: child); : super(key: key, child: child);
@ -253,21 +268,6 @@ class OverflowBox extends OneChildRenderObjectWidget {
} }
} }
class ConstrainedBox extends OneChildRenderObjectWidget {
ConstrainedBox({ Key key, this.constraints, Widget child })
: super(key: key, child: child) {
assert(constraints != null);
}
final BoxConstraints constraints;
RenderConstrainedBox createRenderObject() => new RenderConstrainedBox(additionalConstraints: constraints);
void updateRenderObject(RenderConstrainedBox renderObject, ConstrainedBox oldWidget) {
renderObject.additionalConstraints = constraints;
}
}
class AspectRatio extends OneChildRenderObjectWidget { class AspectRatio extends OneChildRenderObjectWidget {
AspectRatio({ Key key, this.aspectRatio, Widget child }) AspectRatio({ Key key, this.aspectRatio, Widget child })
: super(key: key, child: child) { : super(key: key, child: child) {