diff --git a/examples/stocks2/lib/stock_app.dart b/examples/stocks2/lib/stock_app.dart index fe4f8b49e13b1e5736186f6d4b9511f8873fb383..0b07d84f872dea502dcf7bd454d10ae5df697911 100644 --- a/examples/stocks2/lib/stock_app.dart +++ b/examples/stocks2/lib/stock_app.dart @@ -130,7 +130,7 @@ class StocksApp extends App { icon: 'action/thumb_up', onGestureTap: (event) => _handleStockModeChange(StockMode.optimistic), children: [ - new FlexExpandingChild(new Text('Optimistic'), 1), + new FlexExpandingChild(new Text('Optimistic'), flex: 1), new Radio(key: 'optimistic-radio', value: StockMode.optimistic, groupValue: _stockMode, onChanged: _handleStockModeChange) ]), new MenuItem( @@ -138,7 +138,7 @@ class StocksApp extends App { icon: 'action/thumb_down', onGestureTap: (event) => _handleStockModeChange(StockMode.pessimistic), children: [ - new FlexExpandingChild(new Text('Pessimistic'), 1), + new FlexExpandingChild(new Text('Pessimistic'), flex: 1), new Radio(key: 'pessimistic-radio', value: StockMode.pessimistic, groupValue: _stockMode, onChanged: _handleStockModeChange) ]), new MenuDivider(key: 'div2'), diff --git a/sdk/lib/framework/components2/menu_item.dart b/sdk/lib/framework/components2/menu_item.dart index bf47b4d31d56267516d0ea194aa8dfe0ff7c2d9f..e3487edc2ae6ed55976276a47cbd9a9990b5e206 100644 --- a/sdk/lib/framework/components2/menu_item.dart +++ b/sdk/lib/framework/components2/menu_item.dart @@ -11,7 +11,7 @@ class MenuItem extends ButtonBase { static const BoxDecoration highlightDecoration = const BoxDecoration( backgroundColor: const Color.fromARGB(102, 153, 153, 153) - ); + ); List children; String icon; @@ -36,7 +36,7 @@ class MenuItem extends ButtonBase { ), padding: const EdgeDims.symmetric(horizontal: 16.0) ), - 1 + flex: 1 ) ] ), diff --git a/sdk/lib/framework/fn2.dart b/sdk/lib/framework/fn2.dart index 9ca123fcf61108d89ec67221dad9ca66b7e1672d..931d4f379ef132c2c3b0674c41fdf6c509439528 100644 --- a/sdk/lib/framework/fn2.dart +++ b/sdk/lib/framework/fn2.dart @@ -154,7 +154,7 @@ abstract class UINode { abstract class ContentNode extends UINode { UINode content; - ContentNode(UINode content) : this.content = content, super(key: content._key); + ContentNode(UINode content, { Object key }) : this.content = content, super(key: key); void _sync(UINode old, dynamic slot) { UINode oldContent = old == null ? null : (old as ContentNode).content; @@ -173,7 +173,7 @@ abstract class ContentNode extends UINode { class ParentDataNode extends ContentNode { final ParentData parentData; - ParentDataNode(UINode content, this.parentData): super(content); + ParentDataNode(UINode content, this.parentData, { Object key }): super(content, key: key); } typedef void GestureEventListener(sky.GestureEvent e); @@ -754,8 +754,8 @@ class FlexContainer extends MultiChildRenderObjectWrapper { } class FlexExpandingChild extends ParentDataNode { - FlexExpandingChild(UINode content, [int flex = 1]) - : super(content, new FlexBoxParentData()..flex = flex); + FlexExpandingChild(UINode content, { int flex: 1, Object key }) + : super(content, new FlexBoxParentData()..flex = flex, key: key); } class Image extends RenderObjectWrapper {