Rename Container's desiredSize argument to width and height arguments.

Also change SizedBox.

This makes the code that uses Container() and SizedBox() much more readable.

The underlying RenderSizedBox is not affected by this change.

R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1166203002
This commit is contained in:
Hixie
2015-06-08 14:36:19 -07:00
parent 62bff5f7ef
commit 8ade37c5aa
2 changed files with 5 additions and 5 deletions

View File

@@ -24,13 +24,13 @@ class ContainerApp extends App {
new Container(
padding: new EdgeDims.all(10.0),
margin: new EdgeDims.all(10.0),
desiredSize: new sky.Size(double.INFINITY, 100.0),
height: 100.0,
decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00)),
child: new BlockContainer(
children: [
new Container(
decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFFFFFF00)),
desiredSize: new sky.Size(double.INFINITY, 20.0)
height: 20.0,
),
new Image(src: "https://www.dartlang.org/logos/dart-logo.png",
size: new sky.Size(300.0, 300.0),

View File

@@ -32,21 +32,21 @@ class StockRow extends Component {
// ),
new FlexExpandingChild(new Text(stock.symbol)),
new Container(
desiredSize: const sky.Size.fromWidth(75.0),
width: 75.0,
padding: const EdgeDims.only(right: 16.0),
// text-align: right
child: new Text(lastSale)
),
// text-align: right, ${typography.black.caption};
new SizedBox(
desiredSize: const sky.Size.fromWidth(75.0),
width: 75.0,
child: new Text(changeInPrice)
),
];
return new Container(
padding: const EdgeDims(16.0, 16.0, 20.0, 16.0),
desiredSize: const sky.Size.fromHeight(kHeight),
height: kHeight,
decoration: const BoxDecoration(
backgroundColor: const sky.Color(0xFFFFFFFF),
border: const Border(