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

Side by Side Diff: sky/examples/stocks-fn/lib/stock_app.dart

Issue 1027653002: [Effen] add StyleNode (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: moar Created 5 years, 9 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 | « no previous file | sky/framework/components/fixed_height_scrollable.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/components/action_bar.dart'; 5 import 'package:sky/framework/components/action_bar.dart';
6 import 'package:sky/framework/components/drawer.dart'; 6 import 'package:sky/framework/components/drawer.dart';
7 import 'package:sky/framework/components/drawer_header.dart'; 7 import 'package:sky/framework/components/drawer_header.dart';
8 import 'package:sky/framework/components/floating_action_button.dart'; 8 import 'package:sky/framework/components/floating_action_button.dart';
9 import 'package:sky/framework/components/icon.dart'; 9 import 'package:sky/framework/components/icon.dart';
10 import 'package:sky/framework/components/input.dart'; 10 import 'package:sky/framework/components/input.dart';
(...skipping 22 matching lines...) Expand all
33 static Style _iconStyle = new Style(''' 33 static Style _iconStyle = new Style('''
34 padding: 8px;''' 34 padding: 8px;'''
35 ); 35 );
36 36
37 static Style _titleStyle = new Style(''' 37 static Style _titleStyle = new Style('''
38 padding-left: 24px; 38 padding-left: 24px;
39 flex: 1; 39 flex: 1;
40 ${typography.white.title};''' 40 ${typography.white.title};'''
41 ); 41 );
42 42
43 static Style _stocklistHeight = new Style('''
44 flex: 1;'''
45 );
46
43 List<Stock> _sortedStocks; 47 List<Stock> _sortedStocks;
44 bool _isSearching = false; 48 bool _isSearching = false;
45 bool _isShowingMenu = false; 49 bool _isShowingMenu = false;
46 String _searchQuery; 50 String _searchQuery;
47 51
48 StocksApp() : super() { 52 StocksApp() : super() {
49 _sortedStocks = oracle.stocks; 53 _sortedStocks = oracle.stocks;
50 _sortedStocks.sort((a, b) => a.symbol.compareTo(b.symbol)); 54 _sortedStocks.sort((a, b) => a.symbol.compareTo(b.symbol));
51 } 55 }
52 56
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 ), 134 ),
131 new EventTarget( 135 new EventTarget(
132 new Icon(key: 'more_white', style: _iconStyle, 136 new Icon(key: 'more_white', style: _iconStyle,
133 size: 24, 137 size: 24,
134 type: 'navigation/more_vert_white'), 138 type: 'navigation/more_vert_white'),
135 onGestureTap: _handleMenuClick 139 onGestureTap: _handleMenuClick
136 ) 140 )
137 ] 141 ]
138 ); 142 );
139 143
140 var list = new Stocklist(stocks: _sortedStocks, query: _searchQuery); 144 var list = new StyleNode(
145 new Stocklist(stocks: _sortedStocks, query: _searchQuery),
146 _stocklistHeight);
141 147
142 var fab = new FloatingActionButton(content: new Icon( 148 var fab = new FloatingActionButton(content: new Icon(
143 type: 'content/add_white', size: 24), level: 3); 149 type: 'content/add_white', size: 24), level: 3);
144 150
145 var children = [ 151 var children = [
146 new Container( 152 new Container(
147 key: 'Content', 153 key: 'Content',
148 style: _style, 154 style: _style,
149 children: [toolbar, list] 155 children: [toolbar, list]
150 ), 156 ),
(...skipping 12 matching lines...) Expand all
163 _menuController = null; 169 _menuController = null;
164 }); 170 });
165 } 171 }
166 ); 172 );
167 children.add(menu); 173 children.add(menu);
168 } 174 }
169 175
170 return new Container(key: 'StocksApp', children: children); 176 return new Container(key: 'StocksApp', children: children);
171 } 177 }
172 } 178 }
OLDNEW
« no previous file with comments | « no previous file | sky/framework/components/fixed_height_scrollable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698