| 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/editing2/input.dart'; | 5 import 'package:sky/editing2/input.dart'; |
| 6 import 'package:sky/theme2/colors.dart' as colors; | 6 import 'package:sky/theme2/colors.dart' as colors; |
| 7 import 'package:sky/theme2/typography.dart' as typography; | 7 import 'package:sky/theme2/typography.dart' as typography; |
| 8 import 'package:sky/widgets/basic.dart'; | 8 import 'package:sky/widgets/basic.dart'; |
| 9 import 'package:sky/widgets/drawer.dart'; | 9 import 'package:sky/widgets/drawer.dart'; |
| 10 import 'package:sky/widgets/drawer_header.dart'; | 10 import 'package:sky/widgets/drawer_header.dart'; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 }); | 107 }); |
| 108 } | 108 } |
| 109 | 109 |
| 110 Drawer buildDrawer() { | 110 Drawer buildDrawer() { |
| 111 return new Drawer( | 111 return new Drawer( |
| 112 controller: _drawerController, | 112 controller: _drawerController, |
| 113 level: 3, | 113 level: 3, |
| 114 children: [ | 114 children: [ |
| 115 new DrawerHeader(children: [new Text('Stocks')]), | 115 new DrawerHeader(children: [new Text('Stocks')]), |
| 116 new MenuItem( | 116 new MenuItem( |
| 117 key: 'Stock list', | |
| 118 icon: 'action/assessment', | 117 icon: 'action/assessment', |
| 119 children: [new Text('Stock List')]), | 118 children: [new Text('Stock List')]), |
| 120 new MenuItem( | 119 new MenuItem( |
| 121 key: 'Account Balance', | |
| 122 icon: 'action/account_balance', | 120 icon: 'action/account_balance', |
| 123 children: [new Text('Account Balance')]), | 121 children: [new Text('Account Balance')]), |
| 124 new MenuDivider(key: 'div1'), | 122 new MenuDivider(), |
| 125 new MenuItem( | 123 new MenuItem( |
| 126 key: 'Optimistic Menu Item', | |
| 127 icon: 'action/thumb_up', | 124 icon: 'action/thumb_up', |
| 128 onGestureTap: (event) => _handleStockModeChange(StockMode.optimistic), | 125 onGestureTap: (event) => _handleStockModeChange(StockMode.optimistic), |
| 129 children: [ | 126 children: [ |
| 130 new Flexible(child: new Text('Optimistic')), | 127 new Flexible(child: new Text('Optimistic')), |
| 131 new Radio(key: 'optimistic-radio', value: StockMode.optimistic, grou
pValue: _stockMode, onChanged: _handleStockModeChange) | 128 new Radio(value: StockMode.optimistic, groupValue: _stockMode, onCha
nged: _handleStockModeChange) |
| 132 ]), | 129 ]), |
| 133 new MenuItem( | 130 new MenuItem( |
| 134 key: 'Pessimistic Menu Item', | |
| 135 icon: 'action/thumb_down', | 131 icon: 'action/thumb_down', |
| 136 onGestureTap: (event) => _handleStockModeChange(StockMode.pessimistic)
, | 132 onGestureTap: (event) => _handleStockModeChange(StockMode.pessimistic)
, |
| 137 children: [ | 133 children: [ |
| 138 new Flexible(child: new Text('Pessimistic')), | 134 new Flexible(child: new Text('Pessimistic')), |
| 139 new Radio(key: 'pessimistic-radio', value: StockMode.pessimistic, gr
oupValue: _stockMode, onChanged: _handleStockModeChange) | 135 new Radio(value: StockMode.pessimistic, groupValue: _stockMode, onCh
anged: _handleStockModeChange) |
| 140 ]), | 136 ]), |
| 141 new MenuDivider(key: 'div2'), | 137 new MenuDivider(), |
| 142 new MenuItem( | 138 new MenuItem( |
| 143 key: 'Settings', | |
| 144 icon: 'action/settings', | 139 icon: 'action/settings', |
| 145 onGestureTap: (event) => _navigator.pushNamed('/settings'), | 140 onGestureTap: (event) => _navigator.pushNamed('/settings'), |
| 146 children: [new Text('Settings')]), | 141 children: [new Text('Settings')]), |
| 147 new MenuItem( | 142 new MenuItem( |
| 148 key: 'Help & Feedback', | |
| 149 icon: 'action/help', | 143 icon: 'action/help', |
| 150 children: [new Text('Help & Feedback')]) | 144 children: [new Text('Help & Feedback')]) |
| 151 ] | 145 ] |
| 152 ); | 146 ); |
| 153 } | 147 } |
| 154 | 148 |
| 155 Widget buildToolBar() { | 149 Widget buildToolBar() { |
| 156 return new ToolBar( | 150 return new ToolBar( |
| 157 left: new IconButton( | 151 left: new IconButton( |
| 158 icon: 'navigation/menu_white', | 152 icon: 'navigation/menu_white', |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 floatingActionButton: new FloatingActionButton( | 198 floatingActionButton: new FloatingActionButton( |
| 205 child: new Icon(type: 'content/add_white', size: 24) | 199 child: new Icon(type: 'content/add_white', size: 24) |
| 206 ), | 200 ), |
| 207 drawer: _drawerShowing ? buildDrawer() : null | 201 drawer: _drawerShowing ? buildDrawer() : null |
| 208 ), | 202 ), |
| 209 ]; | 203 ]; |
| 210 addMenuToOverlays(overlays); | 204 addMenuToOverlays(overlays); |
| 211 return new Stack(overlays); | 205 return new Stack(overlays); |
| 212 } | 206 } |
| 213 } | 207 } |
| OLD | NEW |