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

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

Issue 1179763009: Give ParentDataNodes snappier names (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: nit 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/examples/stocks2/lib/stock_menu.dart ('k') | sky/examples/widgets/container.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/rendering/box.dart'; 5 import 'package:sky/rendering/box.dart';
6 import 'package:sky/theme2/typography.dart' as typography; 6 import 'package:sky/theme2/typography.dart' as typography;
7 import 'package:sky/widgets/ink_well.dart'; 7 import 'package:sky/widgets/ink_well.dart';
8 import 'package:sky/widgets/basic.dart'; 8 import 'package:sky/widgets/basic.dart';
9 import 'package:sky/rendering/paragraph.dart'; 9 import 'package:sky/rendering/paragraph.dart';
10 10
(...skipping 11 matching lines...) Expand all
22 UINode build() { 22 UINode build() {
23 String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}"; 23 String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}";
24 24
25 String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%"; 25 String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%";
26 if (stock.percentChange > 0) changeInPrice = "+" + changeInPrice; 26 if (stock.percentChange > 0) changeInPrice = "+" + changeInPrice;
27 27
28 List<UINode> children = [ 28 List<UINode> children = [
29 new Container( 29 new Container(
30 child: new StockArrow(percentChange: stock.percentChange), 30 child: new StockArrow(percentChange: stock.percentChange),
31 margin: const EdgeDims.only(right: 5.0)), 31 margin: const EdgeDims.only(right: 5.0)),
32 new FlexExpandingChild(new Text(stock.symbol), flex: 2, key: "symbol"), 32 new Flexible(child: new Text(stock.symbol), flex: 2, key: "symbol"),
33 // TODO(hansmuller): text-align: right 33 // TODO(hansmuller): text-align: right
34 new FlexExpandingChild(new Text(lastSale, 34 new Flexible(child: new Text(lastSale,
35 style: const TextStyle(textAlign: TextAlign.right)), 35 style: const TextStyle(textAlign: TextAlign.right)),
36 key: "lastSale"), 36 key: "lastSale"),
37 new FlexExpandingChild(new Text(changeInPrice, 37 new Flexible(child: new Text(changeInPrice,
38 style: typography.black.caption.copyWith(textAlign: TextAlign.right)), 38 style: typography.black.caption.copyWith(textAlign: TextAlign.right)),
39 key: "changeInPrice") 39 key: "changeInPrice")
40 ]; 40 ];
41 41
42 // TODO(hansmuller): An explicit |height| shouldn't be needed 42 // TODO(hansmuller): An explicit |height| shouldn't be needed
43 return new InkWell( 43 return new InkWell(
44 child: new Container( 44 child: new Container(
45 padding: const EdgeDims(16.0, 16.0, 20.0, 16.0), 45 padding: const EdgeDims(16.0, 16.0, 20.0, 16.0),
46 height: kHeight, 46 height: kHeight,
47 decoration: const BoxDecoration( 47 decoration: const BoxDecoration(
48 border: const Border( 48 border: const Border(
49 bottom: const BorderSide(color: const Color(0xFFF4F4F4)))), 49 bottom: const BorderSide(color: const Color(0xFFF4F4F4)))),
50 child: new Flex(children) 50 child: new Flex(children)
51 ) 51 )
52 ); 52 );
53 } 53 }
54 } 54 }
OLDNEW
« no previous file with comments | « sky/examples/stocks2/lib/stock_menu.dart ('k') | sky/examples/widgets/container.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698