Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: sky/examples/stocks2/lib/stock_menu.dart

Issue 1173493003: Extend Sky's RenderFlex with intrinsic sizes and compute cross-size height (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix bugs Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698