Index: sky/examples/stocks/lib/stock_menu.dart |
diff --git a/sky/examples/stocks/lib/stock_menu.dart b/sky/examples/stocks/lib/stock_menu.dart |
index 03b09983d11b1dce2052df7ee51d0c7594daf15b..33d19831685a536f6bb44b06279228a4bb56d1e8 100644 |
--- a/sky/examples/stocks/lib/stock_menu.dart |
+++ b/sky/examples/stocks/lib/stock_menu.dart |
@@ -2,8 +2,10 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-import 'package:sky/framework/components/popup_menu.dart'; |
import 'package:sky/framework/fn.dart'; |
+import 'package:sky/framework/layout.dart'; |
+import 'package:sky/framework/components/popup_menu.dart'; |
+import 'package:sky/framework/components/checkbox.dart'; |
import 'package:sky/framework/theme/view_configuration.dart'; |
class StockMenu extends Component { |
@@ -14,16 +16,26 @@ class StockMenu extends Component { |
PopupMenuController controller; |
- StockMenu({Object key, this.controller}) : super(key: key); |
+ StockMenu({Object key, this.controller, this.autorefresh: false, this.onAutorefreshChanged}) : super(key: key); |
+ |
+ final bool autorefresh; |
+ final ValueChanged onAutorefreshChanged; |
+ |
+ static FlexBoxParentData _flex1 = new FlexBoxParentData()..flex = 1; |
UINode build() { |
+ var checkbox = new Checkbox( |
+ checked: this.autorefresh, |
+ onChanged: this.onAutorefreshChanged |
+ ); |
+ |
return new StyleNode( |
new PopupMenu( |
controller: controller, |
items: [ |
[new Text('Add stock')], |
[new Text('Remove stock')], |
- [new Text('Help & feedback')], |
+ [new ParentDataNode(new Text('Autorefresh'), _flex1), checkbox], |
], |
level: 4), |
_style |