| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:sky/framework/components2/tool_bar.dart'; | 5 import 'package:sky/framework/components2/tool_bar.dart'; |
| 6 import 'package:sky/framework/components2/drawer.dart'; | 6 import 'package:sky/framework/components2/drawer.dart'; |
| 7 // import 'package:sky/framework/components2/drawer_header.dart'; | 7 // import 'package:sky/framework/components2/drawer_header.dart'; |
| 8 // import 'package:sky/framework/components2/floating_action_button.dart'; | 8 // import 'package:sky/framework/components2/floating_action_button.dart'; |
| 9 // import 'package:sky/framework/components2/icon.dart'; | 9 // import 'package:sky/framework/components2/icon.dart'; |
| 10 import 'package:sky/framework/components2/icon_button.dart'; | 10 import 'package:sky/framework/components2/icon_button.dart'; |
| 11 // import 'package:sky/framework/components2/input.dart'; | 11 // import 'package:sky/framework/components2/input.dart'; |
| 12 // import 'package:sky/framework/components2/menu_divider.dart'; | 12 // import 'package:sky/framework/components2/menu_divider.dart'; |
| 13 // import 'package:sky/framework/components2/menu_item.dart'; | 13 import 'package:sky/framework/components2/menu_item.dart'; |
| 14 // import 'package:sky/framework/components2/modal_overlay.dart'; | 14 // import 'package:sky/framework/components2/modal_overlay.dart'; |
| 15 // import 'package:sky/framework/components2/popup_menu.dart'; | 15 // import 'package:sky/framework/components2/popup_menu.dart'; |
| 16 // import 'package:sky/framework/components2/radio.dart'; | 16 // import 'package:sky/framework/components2/radio.dart'; |
| 17 import 'package:sky/framework/components2/scaffold.dart'; | 17 import 'package:sky/framework/components2/scaffold.dart'; |
| 18 import 'package:sky/framework/fn2.dart'; | 18 import 'package:sky/framework/fn2.dart'; |
| 19 import 'package:sky/framework/theme2/typography.dart' as typography; | 19 import 'package:sky/framework/theme2/typography.dart' as typography; |
| 20 import 'package:sky/framework/theme2/colors.dart' as colors; | 20 import 'package:sky/framework/theme2/colors.dart' as colors; |
| 21 import 'stock_data.dart'; | 21 import 'stock_data.dart'; |
| 22 import 'package:sky/framework/rendering/box.dart'; | 22 import 'package:sky/framework/rendering/box.dart'; |
| 23 // import 'stock_list.dart'; | 23 // import 'stock_list.dart'; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 setState(() { | 111 setState(() { |
| 112 _stockMode = value; | 112 _stockMode = value; |
| 113 }); | 113 }); |
| 114 } | 114 } |
| 115 | 115 |
| 116 // static FlexBoxParentData _flex1 = new FlexBoxParentData()..flex = 1; | 116 // static FlexBoxParentData _flex1 = new FlexBoxParentData()..flex = 1; |
| 117 | 117 |
| 118 Drawer buildDrawer() { | 118 Drawer buildDrawer() { |
| 119 return new Drawer( | 119 return new Drawer( |
| 120 controller: _drawerController, | 120 controller: _drawerController, |
| 121 level: 3 | 121 level: 3, |
| 122 // , | 122 children: [ |
| 123 // children: [ | 123 // new DrawerHeader(children: [new Text('Stocks')]), |
| 124 // new DrawerHeader(children: [new Text('Stocks')]), | 124 new MenuItem( |
| 125 // new MenuItem( | 125 key: 'Stock list', |
| 126 // key: 'Stock list', | 126 icon: 'action/assessment', |
| 127 // icon: 'action/assessment', | 127 children: [new Text('Stock List')]), |
| 128 // children: [new Text('Stock List')]), | 128 new MenuItem( |
| 129 // new MenuItem( | 129 key: 'Account Balance', |
| 130 // key: 'Account Balance', | 130 icon: 'action/account_balance', |
| 131 // icon: 'action/account_balance', | 131 children: [new Text('Account Balance')]), |
| 132 // children: [new Text('Account Balance')]), | 132 // new MenuDivider(key: 'div1'), |
| 133 // new MenuDivider(key: 'div1'), | 133 // new MenuItem( |
| 134 // new MenuItem( | 134 // key: 'Optimistic Menu Item', |
| 135 // key: 'Optimistic Menu Item', | 135 // icon: 'action/thumb_up', |
| 136 // icon: 'action/thumb_up', | 136 // onGestureTap: (event) => _handleStockModeChange(StockMode.Optimisti
c), |
| 137 // onGestureTap: (event) => _handleStockModeChange(StockMode.Optimisti
c), | 137 // children: [ |
| 138 // children: [ | 138 // new ParentDataNode(new Text('Optimistic'), _flex1), |
| 139 // new ParentDataNode(new Text('Optimistic'), _flex1), | 139 // new Radio(key: 'optimistic-radio', value: StockMode.Optimistic, g
roupValue: _stockMode, onChanged: _handleStockModeChange) |
| 140 // new Radio(key: 'optimistic-radio', value: StockMode.Optimistic, g
roupValue: _stockMode, onChanged: _handleStockModeChange) | 140 // ]), |
| 141 // ]), | 141 // new MenuItem( |
| 142 // new MenuItem( | 142 // key: 'Pessimistic Menu Item', |
| 143 // key: 'Pessimistic Menu Item', | 143 // icon: 'action/thumb_down', |
| 144 // icon: 'action/thumb_down', | 144 // onGestureTap: (event) => _handleStockModeChange(StockMode.Pessimist
ic), |
| 145 // onGestureTap: (event) => _handleStockModeChange(StockMode.Pessimist
ic), | 145 // children: [ |
| 146 // children: [ | 146 // new ParentDataNode(new Text('Pessimistic'), _flex1), |
| 147 // new ParentDataNode(new Text('Pessimistic'), _flex1), | 147 // new Radio(key: 'pessimistic-radio', value: StockMode.Pessimistic,
groupValue: _stockMode, onChanged: _handleStockModeChange) |
| 148 // new Radio(key: 'pessimistic-radio', value: StockMode.Pessimistic,
groupValue: _stockMode, onChanged: _handleStockModeChange) | 148 // ]), |
| 149 // ]), | 149 // new MenuDivider(key: 'div2'), |
| 150 // new MenuDivider(key: 'div2'), | 150 new MenuItem( |
| 151 // new MenuItem( | 151 key: 'Settings', |
| 152 // key: 'Settings', | 152 icon: 'action/settings', |
| 153 // icon: 'action/settings', | 153 children: [new Text('Settings')]), |
| 154 // children: [new Text('Settings')]), | 154 new MenuItem( |
| 155 // new MenuItem( | 155 key: 'Help & Feedback', |
| 156 // key: 'Help & Feedback', | 156 icon: 'action/help', |
| 157 // icon: 'action/help', | 157 children: [new Text('Help & Feedback')]) |
| 158 // children: [new Text('Help & Feedback')]) | 158 ] |
| 159 // ] | |
| 160 ); | 159 ); |
| 161 } | 160 } |
| 162 | 161 |
| 163 UINode buildToolBar() { | 162 UINode buildToolBar() { |
| 164 return new ToolBar( | 163 return new ToolBar( |
| 165 left: new IconButton( | 164 left: new IconButton( |
| 166 icon: 'navigation/menu_white', | 165 icon: 'navigation/menu_white', |
| 167 onGestureTap: _drawerController.toggle), | 166 onGestureTap: _drawerController.toggle), |
| 168 center: new Text('Stocks'), | 167 center: new Text('Stocks'), |
| 169 right: [ | 168 right: [ |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 ]; | 216 ]; |
| 218 addMenuToOverlays(overlays); | 217 addMenuToOverlays(overlays); |
| 219 return new StackContainer(children: overlays); | 218 return new StackContainer(children: overlays); |
| 220 } | 219 } |
| 221 } | 220 } |
| 222 | 221 |
| 223 void main() { | 222 void main() { |
| 224 print("starting stocks app!"); | 223 print("starting stocks app!"); |
| 225 new StocksApp(); | 224 new StocksApp(); |
| 226 } | 225 } |
| OLD | NEW |