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

Side by Side Diff: sky/sdk/example/stocks/lib/stock_menu.dart

Issue 1237213003: Wire up popup menus to back button (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase Created 5 years, 5 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
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | sky/sdk/lib/widgets/popup_menu.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 'dart:sky' as sky; 5 import 'dart:sky' as sky;
6 6
7 import 'package:sky/widgets/basic.dart'; 7 import 'package:sky/widgets/basic.dart';
8 import 'package:sky/widgets/checkbox.dart'; 8 import 'package:sky/widgets/checkbox.dart';
9 import 'package:sky/widgets/navigator.dart';
9 import 'package:sky/widgets/popup_menu_item.dart'; 10 import 'package:sky/widgets/popup_menu_item.dart';
10 import 'package:sky/widgets/popup_menu.dart'; 11 import 'package:sky/widgets/popup_menu.dart';
11 12
12 export 'package:sky/widgets/popup_menu.dart' show PopupMenuStatus; 13 export 'package:sky/widgets/popup_menu.dart' show PopupMenuStatus;
13 14
14 class StockMenu extends Component { 15 class StockMenu extends Component {
15 StockMenu({ 16 StockMenu({
16 String key, 17 String key,
17 this.showing, 18 this.showing,
18 this.onStatusChanged, 19 this.onStatusChanged,
20 this.navigator,
19 this.autorefresh: false, 21 this.autorefresh: false,
20 this.onAutorefreshChanged 22 this.onAutorefreshChanged
21 }) : super(key: key); 23 }) : super(key: key);
22 24
23 bool showing; 25 final bool showing;
24 PopupMenuStatusChangedCallback onStatusChanged; 26 final PopupMenuStatusChangedCallback onStatusChanged;
27 final Navigator navigator;
25 final bool autorefresh; 28 final bool autorefresh;
26 final ValueChanged onAutorefreshChanged; 29 final ValueChanged onAutorefreshChanged;
27 30
28 Widget build() { 31 Widget build() {
29 var checkbox = new Checkbox( 32 var checkbox = new Checkbox(
30 value: this.autorefresh, 33 value: this.autorefresh,
31 onChanged: this.onAutorefreshChanged 34 onChanged: this.onAutorefreshChanged
32 ); 35 );
33 36
34 return new Positioned( 37 return new Positioned(
35 child: new PopupMenu( 38 child: new PopupMenu(
36 items: [ 39 items: [
37 new PopupMenuItem(child: new Text('Add stock')), 40 new PopupMenuItem(child: new Text('Add stock')),
38 new PopupMenuItem(child: new Text('Remove stock')), 41 new PopupMenuItem(child: new Text('Remove stock')),
39 new PopupMenuItem(child: new Flex([new Flexible(child: new Text('Autor efresh')), checkbox])), 42 new PopupMenuItem(child: new Flex([new Flexible(child: new Text('Autor efresh')), checkbox])),
40 ], 43 ],
41 level: 4, 44 level: 4,
42 showing: showing, 45 showing: showing,
43 onStatusChanged: onStatusChanged 46 onStatusChanged: onStatusChanged,
47 navigator: navigator
44 ), 48 ),
45 right: sky.view.paddingRight, 49 right: sky.view.paddingRight,
46 top: sky.view.paddingTop 50 top: sky.view.paddingTop
47 ); 51 );
48 } 52 }
49 } 53 }
OLDNEW
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | sky/sdk/lib/widgets/popup_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698