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; | 11 PopupMenuController controller; |
12 | 12 |
13 StockMenu({Object key, this.controller, this.autorefresh: false, this.onAutore
freshChanged}) : super(key: key); | 13 StockMenu({Object key, this.controller, this.autorefresh: false, this.onAutore
freshChanged}) : super(key: key); |
14 | 14 |
15 final bool autorefresh; | 15 final bool autorefresh; |
16 final ValueChanged onAutorefreshChanged; | 16 final ValueChanged onAutorefreshChanged; |
17 | 17 |
18 UINode build() { | 18 UINode build() { |
19 var checkbox = new Checkbox( | 19 var checkbox = new Checkbox( |
20 checked: this.autorefresh, | 20 checked: this.autorefresh, |
21 onChanged: this.onAutorefreshChanged | 21 onChanged: this.onAutorefreshChanged |
22 ); | 22 ); |
23 | 23 |
24 return new StackPositionedChild( | 24 return new StackPositionedChild( |
25 new PopupMenu( | 25 new PopupMenu( |
26 controller: controller, | 26 controller: controller, |
27 items: [ | 27 items: [ |
28 [new Text('Add stock')], | 28 [new Text('Add stock')], |
29 [new Text('Remove stock')], | 29 [new Text('Remove stock')], |
30 // [new FlexExpandingChild(new Text('Autorefresh')), checkbox], | 30 [new FlexExpandingChild(new Text('Autorefresh')), checkbox], |
31 ], | 31 ], |
32 level: 4 | 32 level: 4 |
33 ), | 33 ), |
34 right: 8.0, | 34 right: 8.0, |
35 top: 8.0 + kStatusBarHeight | 35 top: 8.0 + kStatusBarHeight |
36 ); | 36 ); |
37 } | 37 } |
38 } | 38 } |
OLD | NEW |