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

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

Issue 1157573012: Implement radio button for Sky’s fn2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix syntax error 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
« no previous file with comments | « sky/engine/core/painting/Paint.idl ('k') | sky/sdk/lib/framework/components2/radio.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/framework/components2/tool_bar.dart'; 5 import 'package:sky/framework/components2/tool_bar.dart';
6 import 'package:sky/framework/components2/drawer.dart'; 6 import 'package:sky/framework/components2/drawer.dart';
7 // import 'package:sky/framework/components2/drawer_header.dart'; 7 // import 'package:sky/framework/components2/drawer_header.dart';
8 // import 'package:sky/framework/components2/floating_action_button.dart'; 8 // import 'package:sky/framework/components2/floating_action_button.dart';
9 // import 'package:sky/framework/components2/icon.dart'; 9 // import 'package:sky/framework/components2/icon.dart';
10 import 'package:sky/framework/components2/icon_button.dart'; 10 import 'package:sky/framework/components2/icon_button.dart';
11 import 'package:sky/framework/components2/menu_divider.dart'; 11 import 'package:sky/framework/components2/menu_divider.dart';
12 import 'package:sky/framework/components2/menu_item.dart'; 12 import 'package:sky/framework/components2/menu_item.dart';
13 import 'package:sky/framework/components2/input.dart'; 13 import 'package:sky/framework/components2/input.dart';
14 // import 'package:sky/framework/components2/modal_overlay.dart'; 14 // import 'package:sky/framework/components2/modal_overlay.dart';
15 // import 'package:sky/framework/components2/popup_menu.dart'; 15 // import 'package:sky/framework/components2/popup_menu.dart';
16 // import 'package:sky/framework/components2/radio.dart'; 16 import 'package:sky/framework/components2/radio.dart';
17 import 'package:sky/framework/components2/scaffold.dart'; 17 import 'package:sky/framework/components2/scaffold.dart';
18 import 'package:sky/framework/fn2.dart'; 18 import 'package:sky/framework/fn2.dart';
19 import 'package:sky/framework/theme2/typography.dart' as typography; 19 import 'package:sky/framework/theme2/typography.dart' as typography;
20 import 'package:sky/framework/theme2/colors.dart' as colors; 20 import 'package:sky/framework/theme2/colors.dart' as colors;
21 import 'stock_data.dart'; 21 import 'stock_data.dart';
22 import 'package:sky/framework/rendering/box.dart'; 22 import 'package:sky/framework/rendering/box.dart';
23 import 'stock_list.dart'; 23 import 'stock_list.dart';
24 // import 'stock_menu.dart'; 24 // import 'stock_menu.dart';
25 25
26 import 'dart:async'; 26 import 'dart:async';
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 }); 103 });
104 } 104 }
105 105
106 StockMode _stockMode = StockMode.optimistic; 106 StockMode _stockMode = StockMode.optimistic;
107 void _handleStockModeChange(StockMode value) { 107 void _handleStockModeChange(StockMode value) {
108 setState(() { 108 setState(() {
109 _stockMode = value; 109 _stockMode = value;
110 }); 110 });
111 } 111 }
112 112
113 // static FlexBoxParentData _flex1 = new FlexBoxParentData()..flex = 1;
114
115 Drawer buildDrawer() { 113 Drawer buildDrawer() {
116 return new Drawer( 114 return new Drawer(
117 controller: _drawerController, 115 controller: _drawerController,
118 level: 3, 116 level: 3,
119 children: [ 117 children: [
120 // new DrawerHeader(children: [new Text('Stocks')]), 118 // new DrawerHeader(children: [new Text('Stocks')]),
121 new MenuItem( 119 new MenuItem(
122 key: 'Stock list', 120 key: 'Stock list',
123 icon: 'action/assessment', 121 icon: 'action/assessment',
124 children: [new Text('Stock List')]), 122 children: [new Text('Stock List')]),
125 new MenuItem( 123 new MenuItem(
126 key: 'Account Balance', 124 key: 'Account Balance',
127 icon: 'action/account_balance', 125 icon: 'action/account_balance',
128 children: [new Text('Account Balance')]), 126 children: [new Text('Account Balance')]),
129 new MenuDivider(key: 'div1'), 127 new MenuDivider(key: 'div1'),
130 // new MenuItem( 128 new MenuItem(
131 // key: 'Optimistic Menu Item', 129 key: 'Optimistic Menu Item',
132 // icon: 'action/thumb_up', 130 icon: 'action/thumb_up',
133 // onGestureTap: (event) => _handleStockModeChange(StockMode.optimisti c), 131 onGestureTap: (event) => _handleStockModeChange(StockMode.optimistic),
134 // children: [ 132 children: [
135 // new ParentDataNode(new Text('Optimistic'), _flex1), 133 new FlexExpandingChild(new Text('Optimistic'), 1),
136 // new Radio(key: 'optimistic-radio', value: StockMode.optimistic, g roupValue: _stockMode, onChanged: _handleStockModeChange) 134 new Radio(key: 'optimistic-radio', value: StockMode.optimistic, grou pValue: _stockMode, onChanged: _handleStockModeChange)
137 // ]), 135 ]),
138 // new MenuItem( 136 new MenuItem(
139 // key: 'Pessimistic Menu Item', 137 key: 'Pessimistic Menu Item',
140 // icon: 'action/thumb_down', 138 icon: 'action/thumb_down',
141 // onGestureTap: (event) => _handleStockModeChange(StockMode.pessimist ic), 139 onGestureTap: (event) => _handleStockModeChange(StockMode.pessimistic) ,
142 // children: [ 140 children: [
143 // new ParentDataNode(new Text('Pessimistic'), _flex1), 141 new FlexExpandingChild(new Text('Pessimistic'), 1),
144 // new Radio(key: 'pessimistic-radio', value: StockMode.pessimistic, groupValue: _stockMode, onChanged: _handleStockModeChange) 142 new Radio(key: 'pessimistic-radio', value: StockMode.pessimistic, gr oupValue: _stockMode, onChanged: _handleStockModeChange)
145 // ]), 143 ]),
146 // new MenuDivider(key: 'div2'), 144 new MenuDivider(key: 'div2'),
147 new MenuItem( 145 new MenuItem(
148 key: 'Settings', 146 key: 'Settings',
149 icon: 'action/settings', 147 icon: 'action/settings',
150 children: [new Text('Settings')]), 148 children: [new Text('Settings')]),
151 new MenuItem( 149 new MenuItem(
152 key: 'Help & Feedback', 150 key: 'Help & Feedback',
153 icon: 'action/help', 151 icon: 'action/help',
154 children: [new Text('Help & Feedback')]) 152 children: [new Text('Help & Feedback')])
155 ] 153 ]
156 ); 154 );
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 215 }
218 216
219 void main() { 217 void main() {
220 print("starting stocks app!"); 218 print("starting stocks app!");
221 App app = new StocksApp(); 219 App app = new StocksApp();
222 app.appView.onFrame = () { 220 app.appView.onFrame = () {
223 // uncomment this for debugging: 221 // uncomment this for debugging:
224 // app.appView.debugDumpRenderTree(); 222 // app.appView.debugDumpRenderTree();
225 }; 223 };
226 } 224 }
OLDNEW
« no previous file with comments | « sky/engine/core/painting/Paint.idl ('k') | sky/sdk/lib/framework/components2/radio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698