Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(945)

Unified Diff: sky/sdk/lib/framework/fn2.dart

Issue 1166203002: Rename Container's desiredSize argument to width and height arguments. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/components2/tool_bar.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/fn2.dart
diff --git a/sky/sdk/lib/framework/fn2.dart b/sky/sdk/lib/framework/fn2.dart
index 4aa77fa26466d5990f156e8252869a663ef57efa..727f56adcb2e657ab22c64aab6ffe22df22c1368 100644
--- a/sky/sdk/lib/framework/fn2.dart
+++ b/sky/sdk/lib/framework/fn2.dart
@@ -408,10 +408,11 @@ class SizedBox extends OneChildRenderObjectWrapper {
final Size desiredSize;
SizedBox({
- this.desiredSize: sky.Size.infinite,
+ double width: double.INFINITY,
+ double height: double.INFINITY,
UINode child,
Object key
- }) : super(child: child, key: key);
+ }) : desiredSize = new Size(width, height), super(child: child, key: key);
RenderSizedBox createNode() => new RenderSizedBox(desiredSize: desiredSize);
@@ -958,14 +959,16 @@ class Container extends Component {
final EdgeDims margin;
final EdgeDims padding;
final Matrix4 transform;
- final Size desiredSize;
+ final double width;
+ final double height;
Container({
Object key,
this.child,
this.constraints,
this.decoration,
- this.desiredSize,
+ this.width,
+ this.height,
this.margin,
this.padding,
this.transform
@@ -974,14 +977,21 @@ class Container extends Component {
UINode build() {
UINode current = child;
+ if (child == null && width == null && height == null)
+ current = new SizedBox();
+
if (padding != null)
current = new Padding(padding: padding, child: current);
if (decoration != null)
current = new DecoratedBox(decoration: decoration, child: current);
- if (desiredSize != null)
- current = new SizedBox(desiredSize: desiredSize, child: current);
+ if (width != null || height != null)
+ current = new SizedBox(
+ width: width == null ? double.INFINITY : width,
+ height: height == null ? double.INFINITY : height,
+ child: current
+ );
if (constraints != null)
current = new ConstrainedBox(constraints: constraints, child: current);
@@ -992,9 +1002,6 @@ class Container extends Component {
if (transform != null)
current = new Transform(transform: transform, child: current);
- if (current == null)
- current = new SizedBox();
-
return current;
}
}
« no previous file with comments | « sky/sdk/lib/framework/components2/tool_bar.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698