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

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

Issue 1011023003: Make stocks-fn match the style for the Sky SDK (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: more 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 | « sky/examples/stocks-fn/lib/stock_list.dart ('k') | sky/examples/stocks-fn/main.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 part of stocksapp; 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
3 // found in the LICENSE file.
4
5 import 'package:sky/framework/components/material.dart';
6 import 'package:sky/framework/fn.dart';
7 import 'package:sky/framework/theme/typography.dart' as typography;
8 import 'stock_arrow.dart';
9 import 'stock_data.dart';
2 10
3 class StockRow extends Component { 11 class StockRow extends Component {
4 12 static final Style _style = new Style('''
5 Stock stock;
6
7 static Style _style = new Style('''
8 transform: translateX(0); 13 transform: translateX(0);
9 display: flex; 14 display: flex;
10 align-items: center; 15 align-items: center;
11 border-bottom: 1px solid #F4F4F4; 16 border-bottom: 1px solid #F4F4F4;
12 padding-top: 16px; 17 padding-top: 16px;
13 padding-left: 16px; 18 padding-left: 16px;
14 padding-right: 16px; 19 padding-right: 16px;
15 padding-bottom: 20px;''' 20 padding-bottom: 20px;'''
16 ); 21 );
17 22
18 static Style _tickerStyle = new Style(''' 23 static final Style _tickerStyle = new Style('''
19 flex: 1;''' 24 flex: 1;'''
20 ); 25 );
21 26
22 static Style _lastSaleStyle = new Style(''' 27 static final Style _lastSaleStyle = new Style('''
23 text-align: right; 28 text-align: right;
24 padding-right: 16px;''' 29 padding-right: 16px;'''
25 ); 30 );
26 31
27 static Style _changeStyle = new Style(''' 32 static final Style _changeStyle = new Style('''
28 ${typography.black.caption}; 33 ${typography.black.caption};
29 text-align: right;''' 34 text-align: right;'''
30 ); 35 );
31 36
37 Stock stock;
38
32 StockRow({Stock stock}) : super(key: stock.symbol) { 39 StockRow({Stock stock}) : super(key: stock.symbol) {
33 this.stock = stock; 40 this.stock = stock;
34 } 41 }
35 42
36 Node build() { 43 Node build() {
37 String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}"; 44 String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}";
38 45
39 String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%"; 46 String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%";
40 if (stock.percentChange > 0) 47 if (stock.percentChange > 0)
41 changeInPrice = "+" + changeInPrice; 48 changeInPrice = "+" + changeInPrice;
(...skipping 18 matching lines...) Expand all
60 children: [new Text(changeInPrice)] 67 children: [new Text(changeInPrice)]
61 ) 68 )
62 ]; 69 ];
63 70
64 return new Material( 71 return new Material(
65 style: _style, 72 style: _style,
66 children: children 73 children: children
67 ); 74 );
68 } 75 }
69 } 76 }
OLDNEW
« no previous file with comments | « sky/examples/stocks-fn/lib/stock_list.dart ('k') | sky/examples/stocks-fn/main.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698