Give ParentDataNodes snappier names
FlexExpandingChild -> Flexible StackPositionedChild -> Positioned Also, name the child argument |child| for consistency. TBR=ianh@google.com Review URL: https://codereview.chromium.org/1179763009.
This commit is contained in:
@@ -127,7 +127,7 @@ class StocksApp extends App {
|
||||
icon: 'action/thumb_up',
|
||||
onGestureTap: (event) => _handleStockModeChange(StockMode.optimistic),
|
||||
children: [
|
||||
new FlexExpandingChild(new Text('Optimistic'), flex: 1),
|
||||
new Flexible(child: new Text('Optimistic')),
|
||||
new Radio(key: 'optimistic-radio', value: StockMode.optimistic, groupValue: _stockMode, onChanged: _handleStockModeChange)
|
||||
]),
|
||||
new MenuItem(
|
||||
@@ -135,7 +135,7 @@ class StocksApp extends App {
|
||||
icon: 'action/thumb_down',
|
||||
onGestureTap: (event) => _handleStockModeChange(StockMode.pessimistic),
|
||||
children: [
|
||||
new FlexExpandingChild(new Text('Pessimistic'), flex: 1),
|
||||
new Flexible(child: new Text('Pessimistic')),
|
||||
new Radio(key: 'pessimistic-radio', value: StockMode.pessimistic, groupValue: _stockMode, onChanged: _handleStockModeChange)
|
||||
]),
|
||||
new MenuDivider(key: 'div2'),
|
||||
|
||||
@@ -26,13 +26,13 @@ class StockMenu extends Component {
|
||||
onChanged: this.onAutorefreshChanged
|
||||
);
|
||||
|
||||
return new StackPositionedChild(
|
||||
new PopupMenu(
|
||||
return new Positioned(
|
||||
child: new PopupMenu(
|
||||
controller: controller,
|
||||
items: [
|
||||
[new Text('Add stock')],
|
||||
[new Text('Remove stock')],
|
||||
[new FlexExpandingChild(new Text('Autorefresh')), checkbox],
|
||||
[new Flexible(child: new Text('Autorefresh')), checkbox],
|
||||
],
|
||||
level: 4
|
||||
),
|
||||
|
||||
@@ -29,12 +29,12 @@ class StockRow extends Component {
|
||||
new Container(
|
||||
child: new StockArrow(percentChange: stock.percentChange),
|
||||
margin: const EdgeDims.only(right: 5.0)),
|
||||
new FlexExpandingChild(new Text(stock.symbol), flex: 2, key: "symbol"),
|
||||
new Flexible(child: new Text(stock.symbol), flex: 2, key: "symbol"),
|
||||
// TODO(hansmuller): text-align: right
|
||||
new FlexExpandingChild(new Text(lastSale,
|
||||
new Flexible(child: new Text(lastSale,
|
||||
style: const TextStyle(textAlign: TextAlign.right)),
|
||||
key: "lastSale"),
|
||||
new FlexExpandingChild(new Text(changeInPrice,
|
||||
new Flexible(child: new Text(changeInPrice,
|
||||
style: typography.black.caption.copyWith(textAlign: TextAlign.right)),
|
||||
key: "changeInPrice")
|
||||
];
|
||||
|
||||
@@ -38,8 +38,8 @@ class ContainerApp extends App {
|
||||
)
|
||||
])
|
||||
),
|
||||
new FlexExpandingChild(
|
||||
new Container(
|
||||
new Flexible(
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFF00FFFF))
|
||||
)
|
||||
),
|
||||
|
||||
@@ -27,8 +27,8 @@ class Rectangle extends Component {
|
||||
Rectangle(this.color, { Object key }) : super(key: key);
|
||||
final Color color;
|
||||
UINode build() {
|
||||
return new FlexExpandingChild(
|
||||
new Container(
|
||||
return new Flexible(
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(backgroundColor: color)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user