| 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/fn2.dart'; | 5 import 'package:sky/framework/fn2.dart'; |
| 6 import 'package:sky/framework/components2/popup_menu.dart'; | 6 import 'package:sky/framework/components2/popup_menu.dart'; |
| 7 import 'package:sky/framework/components2/checkbox.dart'; | 7 import 'package:sky/framework/components2/checkbox.dart'; |
| 8 import 'package:sky/framework/theme/view_configuration.dart'; | 8 import 'package:sky/framework/theme/view_configuration.dart'; |
| 9 | 9 |
| 10 class StockMenu extends Component { | 10 class StockMenu extends Component { |
| 11 PopupMenuController controller; | |
| 12 | 11 |
| 13 StockMenu({Object key, this.controller, this.autorefresh: false, this.onAutore
freshChanged}) : super(key: key); | 12 StockMenu({ |
| 13 Object key, |
| 14 this.controller, |
| 15 this.autorefresh: false, |
| 16 this.onAutorefreshChanged |
| 17 }) : super(key: key); |
| 14 | 18 |
| 19 final PopupMenuController controller; |
| 15 final bool autorefresh; | 20 final bool autorefresh; |
| 16 final ValueChanged onAutorefreshChanged; | 21 final ValueChanged onAutorefreshChanged; |
| 17 | 22 |
| 18 UINode build() { | 23 UINode build() { |
| 19 var checkbox = new Checkbox( | 24 var checkbox = new Checkbox( |
| 20 checked: this.autorefresh, | 25 checked: this.autorefresh, |
| 21 onChanged: this.onAutorefreshChanged | 26 onChanged: this.onAutorefreshChanged |
| 22 ); | 27 ); |
| 23 | 28 |
| 24 return new StackPositionedChild( | 29 return new StackPositionedChild( |
| 25 new PopupMenu( | 30 new PopupMenu( |
| 26 controller: controller, | 31 controller: controller, |
| 27 items: [ | 32 items: [ |
| 28 [new Text('Add stock')], | 33 [new Text('Add stock')], |
| 29 [new Text('Remove stock')], | 34 [new Text('Remove stock')], |
| 30 // [new FlexExpandingChild(new Text('Autorefresh')), checkbox], | 35 // [new FlexExpandingChild(new Text('Autorefresh')), checkbox], |
| 31 ], | 36 ], |
| 32 level: 4 | 37 level: 4 |
| 33 ), | 38 ), |
| 34 right: 8.0, | 39 right: 8.0, |
| 35 top: 8.0 + kStatusBarHeight | 40 top: 8.0 + kStatusBarHeight |
| 36 ); | 41 ); |
| 37 } | 42 } |
| 38 } | 43 } |
| OLD | NEW |