Commit e5581e80 authored by Adam Barth's avatar Adam Barth

stock2 should actually show some stocks data

We're having trouble shrinkwrapping text, so this CL sets an explicit size for
the last sale and the change in price.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1164763006
parent b7c58866
...@@ -7,31 +7,11 @@ import 'package:sky/framework/components2/ink_well.dart'; ...@@ -7,31 +7,11 @@ import 'package:sky/framework/components2/ink_well.dart';
import 'package:sky/framework/fn2.dart'; import 'package:sky/framework/fn2.dart';
import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/theme/typography.dart' as typography; import 'package:sky/framework/theme/typography.dart' as typography;
import 'stock_arrow.dart'; // import 'stock_arrow.dart';
import 'stock_data.dart'; import 'stock_data.dart';
class StockRow extends Component { class StockRow extends Component {
static const double kHeight = 100.0; static const double kHeight = 100.0;
// static final Style _style = new Style('''
// align-items: center;
// border-bottom: 1px solid #F4F4F4;
// padding-top: 16px;
// padding-left: 16px;
// padding-right: 16px;
// padding-bottom: 20px;'''
// );
// static final FlexBoxParentData _tickerFlex = new FlexBoxParentData()..flex = 1;
// static final Style _lastSaleStyle = new Style('''
// text-align: right;
// padding-right: 16px;'''
// );
// static final Style _changeStyle = new Style('''
// ${typography.black.caption};
// text-align: right;'''
// );
Stock stock; Stock stock;
...@@ -40,43 +20,39 @@ class StockRow extends Component { ...@@ -40,43 +20,39 @@ class StockRow extends Component {
} }
UINode build() { UINode build() {
// String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}"; String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}";
// String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%"; String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%";
// if (stock.percentChange > 0) if (stock.percentChange > 0)
// changeInPrice = "+" + changeInPrice; changeInPrice = "+" + changeInPrice;
// List<UINode> children = [ List<UINode> children = [
// new StockArrow( // new StockArrow(
// percentChange: stock.percentChange // percentChange: stock.percentChange
// ), // ),
// new ParentDataNode( new FlexExpandingChild(new Text(stock.symbol)),
// new Container( new Container(
// key: 'Ticker', desiredSize: const sky.Size.fromWidth(75.0),
// children: [new Text(stock.symbol)] padding: const EdgeDims.only(right: 16.0),
// ), // text-align: right
// _tickerFlex child: new Text(lastSale)
// ), ),
// new Container( // text-align: right, ${typography.black.caption};
// key: 'LastSale', new SizedBox(
// style: _lastSaleStyle, desiredSize: const sky.Size.fromWidth(75.0),
// children: [new Text(lastSale)] child: new Text(changeInPrice)
// ), ),
// new Container( ];
// key: 'Change',
// style: _changeStyle,
// children: [new Text(changeInPrice)]
// )
// ];
// return new StyleNode(new InkWell(children: children), _style);
return new Container( return new Container(
padding: const EdgeDims(16.0, 16.0, 20.0, 16.0),
desiredSize: const sky.Size.fromHeight(kHeight), desiredSize: const sky.Size.fromHeight(kHeight),
decoration: const BoxDecoration( decoration: const BoxDecoration(
backgroundColor: const sky.Color(0xFFFFFFFF), backgroundColor: const sky.Color(0xFFFFFFFF),
border: const Border( border: const Border(
bottom: const BorderSide( bottom: const BorderSide(
color: const sky.Color(0xFFF4F4F4), color: const sky.Color(0xFFF4F4F4),
width: 1.0)))); width: 1.0))),
child: new FlexContainer(children: children));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment