diff --git a/examples/material_gallery/lib/demo/grid_list_demo.dart b/examples/material_gallery/lib/demo/grid_list_demo.dart index 9f3ff8128c..169dc66cb8 100644 --- a/examples/material_gallery/lib/demo/grid_list_demo.dart +++ b/examples/material_gallery/lib/demo/grid_list_demo.dart @@ -138,16 +138,16 @@ class GridListDemoState extends State { GridDemoTileStyle tileStyle = GridDemoTileStyle.twoLine; void showTileStyleMenu(BuildContext context) { - final List items = [ - new PopupMenuItem( + final List items = >[ + new PopupMenuItem( value: GridDemoTileStyle.imageOnly, child: new Text('Image only') ), - new PopupMenuItem( + new PopupMenuItem( value: GridDemoTileStyle.oneLine, child: new Text('One line') ), - new PopupMenuItem( + new PopupMenuItem( value: GridDemoTileStyle.twoLine, child: new Text('Two line') ) diff --git a/examples/material_gallery/lib/demo/menu_demo.dart b/examples/material_gallery/lib/demo/menu_demo.dart index 75b51d0cfc..a8d3f9bed4 100644 --- a/examples/material_gallery/lib/demo/menu_demo.dart +++ b/examples/material_gallery/lib/demo/menu_demo.dart @@ -61,16 +61,16 @@ class MenuDemoState extends State { right: [ new PopupMenuButton( onSelected: showMenuSelection, - items: [ - new PopupMenuItem( + items: >[ + new PopupMenuItem( value: 'ToolBar Menu', child: new Text('ToolBar Menu') ), - new PopupMenuItem( + new PopupMenuItem( value: 'Right Here', child: new Text('Right Here') ), - new PopupMenuItem( + new PopupMenuItem( value: 'Hooray!', child: new Text('Hooray!') ), @@ -88,16 +88,16 @@ class MenuDemoState extends State { primary: new Text('An item with a context menu button'), right: new PopupMenuButton( onSelected: showMenuSelection, - items: [ - new PopupMenuItem( + items: >[ + new PopupMenuItem( value: _simpleValue1, child: new Text('Context menu item one') ), - new PopupMenuItem( + new PopupMenuItem( enabled: false, child: new Text('A disabled menu item') ), - new PopupMenuItem( + new PopupMenuItem( value: _simpleValue3, child: new Text('Context menu item three') ), @@ -112,21 +112,21 @@ class MenuDemoState extends State { right: new PopupMenuButton( onSelected: showMenuSelection, items: >[ - new PopupMenuItem( + new PopupMenuItem( value: 'Preview', child: new ListItem( left: new Icon(icon: Icons.visibility), primary: new Text('Preview') ) ), - new PopupMenuItem( + new PopupMenuItem( value: 'Share', child: new ListItem( left: new Icon(icon: Icons.person_add), primary: new Text('Share') ) ), - new PopupMenuItem( + new PopupMenuItem( value: 'Get Link', child: new ListItem( left: new Icon(icon: Icons.link), @@ -134,7 +134,7 @@ class MenuDemoState extends State { ) ), new PopupMenuDivider(), - new PopupMenuItem( + new PopupMenuItem( value: 'Remove', child: new ListItem( left: new Icon(icon: Icons.delete), @@ -154,16 +154,16 @@ class MenuDemoState extends State { primary: new Text('An item with a simple menu'), secondary: new Text(_simpleValue) ), - items: [ - new PopupMenuItem( + items: >[ + new PopupMenuItem( value: _simpleValue1, child: new Text(_simpleValue1) ), - new PopupMenuItem( + new PopupMenuItem( value: _simpleValue2, child: new Text(_simpleValue2) ), - new PopupMenuItem( + new PopupMenuItem( value: _simpleValue3, child: new Text(_simpleValue3) ) @@ -175,23 +175,24 @@ class MenuDemoState extends State { primary: new Text('An item with a checklist menu'), right: new PopupMenuButton( onSelected: showCheckedMenuSelections, - items: [ + items: >[ new CheckedPopupMenuItem( value: _checkedValue1, checked: isChecked(_checkedValue1), child: new Text(_checkedValue1) ), - new CheckedPopupMenuItem( + new CheckedPopupMenuItem( + value: _checkedValue2, enabled: false, checked: isChecked(_checkedValue2), child: new Text(_checkedValue2) ), - new CheckedPopupMenuItem( + new CheckedPopupMenuItem( value: _checkedValue3, checked: isChecked(_checkedValue3), child: new Text(_checkedValue3) ), - new CheckedPopupMenuItem( + new CheckedPopupMenuItem( value: _checkedValue4, checked: isChecked(_checkedValue4), child: new Text(_checkedValue4) diff --git a/examples/stocks/lib/stock_home.dart b/examples/stocks/lib/stock_home.dart index f3b1f962c6..599d1cd867 100644 --- a/examples/stocks/lib/stock_home.dart +++ b/examples/stocks/lib/stock_home.dart @@ -218,21 +218,21 @@ class StockHomeState extends State { ), new PopupMenuButton<_StockMenuItem>( onSelected: (_StockMenuItem value) { _handleStockMenu(context, value); }, - items: [ - new CheckedPopupMenuItem( + items: >[ + new CheckedPopupMenuItem<_StockMenuItem>( value: _StockMenuItem.autorefresh, checked: _autorefresh, child: new Text('Autorefresh') ), - new PopupMenuItem( + new PopupMenuItem<_StockMenuItem>( value: _StockMenuItem.refresh, child: new Text('Refresh') ), - new PopupMenuItem( + new PopupMenuItem<_StockMenuItem>( value: _StockMenuItem.speedUp, child: new Text('Increase animation speed') ), - new PopupMenuItem( + new PopupMenuItem<_StockMenuItem>( value: _StockMenuItem.speedDown, child: new Text('Decrease animation speed') ) diff --git a/examples/widgets/indexed_stack.dart b/examples/widgets/indexed_stack.dart index 57acee9324..7e782b3906 100644 --- a/examples/widgets/indexed_stack.dart +++ b/examples/widgets/indexed_stack.dart @@ -19,18 +19,22 @@ class IndexedStackDemoState extends State { }); } - List _buildMenu() { + List> _buildMenu() { TextStyle style = const TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold); String pad = ''; return new List.generate(_itemCount, (int i) { pad += '-'; - return new PopupMenuItem(value: i, child: new Text('$pad Hello World $i $pad', style: style)); + return new PopupMenuItem(value: i, child: new Text('$pad Hello World $i $pad', style: style)); }); } Widget build(BuildContext context) { - List items = _buildMenu(); - IndexedStack indexedStack = new IndexedStack(children: items, index: _itemIndex, alignment: const FractionalOffset(0.5, 0.0)); + List> items = _buildMenu(); + IndexedStack indexedStack = new IndexedStack( + children: items, + index: _itemIndex, + alignment: const FractionalOffset(0.5, 0.0) + ); return new Scaffold( toolBar: new ToolBar(center: new Text('IndexedStackDemo Demo')),