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

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

Issue 1233983002: Rename MenuItem to DrawerItem (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/drawer_divider.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 'package:sky/widgets/basic.dart'; 5 import 'package:sky/widgets/basic.dart';
6 import 'package:sky/widgets/checkbox.dart'; 6 import 'package:sky/widgets/checkbox.dart';
7 import 'package:sky/widgets/dialog.dart'; 7 import 'package:sky/widgets/dialog.dart';
8 import 'package:sky/widgets/drawer_item.dart';
8 import 'package:sky/widgets/flat_button.dart'; 9 import 'package:sky/widgets/flat_button.dart';
9 import 'package:sky/widgets/icon_button.dart'; 10 import 'package:sky/widgets/icon_button.dart';
10 import 'package:sky/widgets/material.dart'; 11 import 'package:sky/widgets/material.dart';
11 import 'package:sky/widgets/menu_item.dart';
12 import 'package:sky/widgets/navigator.dart'; 12 import 'package:sky/widgets/navigator.dart';
13 import 'package:sky/widgets/scaffold.dart'; 13 import 'package:sky/widgets/scaffold.dart';
14 import 'package:sky/widgets/scrollable_viewport.dart'; 14 import 'package:sky/widgets/scrollable_viewport.dart';
15 import 'package:sky/widgets/switch.dart'; 15 import 'package:sky/widgets/switch.dart';
16 import 'package:sky/widgets/tool_bar.dart'; 16 import 'package:sky/widgets/tool_bar.dart';
17 17
18 import 'stock_types.dart'; 18 import 'stock_types.dart';
19 19
20 typedef void SettingsUpdater({ 20 typedef void SettingsUpdater({
21 StockMode optimism, 21 StockMode optimism,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 Widget buildSettingsPane() { 88 Widget buildSettingsPane() {
89 // TODO(ianh): Once we have the gesture API hooked up, fix https://github.co m/domokit/mojo/issues/281 89 // TODO(ianh): Once we have the gesture API hooked up, fix https://github.co m/domokit/mojo/issues/281
90 // (whereby tapping the widgets below causes both the widget and the menu it em to fire their callbacks) 90 // (whereby tapping the widgets below causes both the widget and the menu it em to fire their callbacks)
91 return new Material( 91 return new Material(
92 type: MaterialType.canvas, 92 type: MaterialType.canvas,
93 child: new ScrollableViewport( 93 child: new ScrollableViewport(
94 child: new Container( 94 child: new Container(
95 padding: const EdgeDims.symmetric(vertical: 20.0), 95 padding: const EdgeDims.symmetric(vertical: 20.0),
96 child: new Block([ 96 child: new Block([
97 new MenuItem( 97 new DrawerItem(
98 icon: 'action/thumb_up', 98 icon: 'action/thumb_up',
99 onPressed: () => _confirmOptimismChange(), 99 onPressed: () => _confirmOptimismChange(),
100 children: [ 100 children: [
101 new Flexible(child: new Text('Everything is awesome')), 101 new Flexible(child: new Text('Everything is awesome')),
102 new Checkbox(value: optimism == StockMode.optimistic, onChanged: _handleOptimismChanged) 102 new Checkbox(value: optimism == StockMode.optimistic, onChanged: _handleOptimismChanged)
103 ] 103 ]
104 ), 104 ),
105 new MenuItem( 105 new DrawerItem(
106 icon: 'action/backup', 106 icon: 'action/backup',
107 onPressed: () { _handleBackupChanged(!(backup == BackupMode.enable d)); }, 107 onPressed: () { _handleBackupChanged(!(backup == BackupMode.enable d)); },
108 children: [ 108 children: [
109 new Flexible(child: new Text('Back up stock list to the cloud')) , 109 new Flexible(child: new Text('Back up stock list to the cloud')) ,
110 new Switch(value: backup == BackupMode.enabled, onChanged: _hand leBackupChanged) 110 new Switch(value: backup == BackupMode.enabled, onChanged: _hand leBackupChanged)
111 ] 111 ]
112 ), 112 ),
113 ]) 113 ])
114 ) 114 )
115 ) 115 )
(...skipping 23 matching lines...) Expand all
139 _handleOptimismChanged(true); 139 _handleOptimismChanged(true);
140 navigator.pop(); 140 navigator.pop();
141 } 141 }
142 ), 142 ),
143 ] 143 ]
144 )); 144 ));
145 } 145 }
146 return new Stack(layers); 146 return new Stack(layers);
147 } 147 }
148 } 148 }
OLDNEW
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | sky/sdk/lib/widgets/drawer_divider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698