| Index: sky/examples/stocks2/lib/stock_row.dart
|
| diff --git a/sky/examples/stocks2/lib/stock_row.dart b/sky/examples/stocks2/lib/stock_row.dart
|
| index 99fd8d815f9c8b6a53e701a7616b1a85b885e6b9..b24c49fe20da7c2cbc59df2aa85a81d317033c63 100644
|
| --- a/sky/examples/stocks2/lib/stock_row.dart
|
| +++ b/sky/examples/stocks2/lib/stock_row.dart
|
| @@ -2,70 +2,81 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +import 'dart:sky' as sky;
|
| import 'package:sky/framework/components2/ink_well.dart';
|
| import 'package:sky/framework/fn2.dart';
|
| +import 'package:sky/framework/rendering/box.dart';
|
| import 'package:sky/framework/theme/typography.dart' as typography;
|
| import 'stock_arrow.dart';
|
| import 'stock_data.dart';
|
|
|
| class StockRow extends Component {
|
| - 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 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 FlexBoxParentData _tickerFlex = new FlexBoxParentData()..flex = 1;
|
|
|
| - static final Style _lastSaleStyle = new Style('''
|
| - text-align: right;
|
| - padding-right: 16px;'''
|
| - );
|
| + // static final Style _lastSaleStyle = new Style('''
|
| + // text-align: right;
|
| + // padding-right: 16px;'''
|
| + // );
|
|
|
| - static final Style _changeStyle = new Style('''
|
| - ${typography.black.caption};
|
| - text-align: right;'''
|
| - );
|
| + // static final Style _changeStyle = new Style('''
|
| + // ${typography.black.caption};
|
| + // text-align: right;'''
|
| + // );
|
|
|
| Stock stock;
|
|
|
| - StockRow({Stock stock}) : super(key: stock.symbol) {
|
| + StockRow({ Stock stock }) : super(key: stock.symbol) {
|
| this.stock = stock;
|
| }
|
|
|
| UINode build() {
|
| - String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}";
|
| + // String lastSale = "\$${stock.lastSale.toStringAsFixed(2)}";
|
|
|
| - String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%";
|
| - if (stock.percentChange > 0)
|
| - changeInPrice = "+" + changeInPrice;
|
| + // String changeInPrice = "${stock.percentChange.toStringAsFixed(2)}%";
|
| + // if (stock.percentChange > 0)
|
| + // changeInPrice = "+" + changeInPrice;
|
|
|
| - List<UINode> children = [
|
| - new StockArrow(
|
| - percentChange: stock.percentChange
|
| - ),
|
| - new ParentDataNode(
|
| - new Container(
|
| - key: 'Ticker',
|
| - children: [new Text(stock.symbol)]
|
| - ),
|
| - _tickerFlex
|
| - ),
|
| - new Container(
|
| - key: 'LastSale',
|
| - style: _lastSaleStyle,
|
| - children: [new Text(lastSale)]
|
| - ),
|
| - new Container(
|
| - key: 'Change',
|
| - style: _changeStyle,
|
| - children: [new Text(changeInPrice)]
|
| - )
|
| - ];
|
| + // List<UINode> children = [
|
| + // new StockArrow(
|
| + // percentChange: stock.percentChange
|
| + // ),
|
| + // new ParentDataNode(
|
| + // new Container(
|
| + // key: 'Ticker',
|
| + // children: [new Text(stock.symbol)]
|
| + // ),
|
| + // _tickerFlex
|
| + // ),
|
| + // new Container(
|
| + // key: 'LastSale',
|
| + // style: _lastSaleStyle,
|
| + // children: [new Text(lastSale)]
|
| + // ),
|
| + // new Container(
|
| + // key: 'Change',
|
| + // style: _changeStyle,
|
| + // children: [new Text(changeInPrice)]
|
| + // )
|
| + // ];
|
|
|
| - return new StyleNode(new InkWell(children: children), _style);
|
| + // return new StyleNode(new InkWell(children: children), _style);
|
| + return new Container(
|
| + desiredSize: const sky.Size.fromHeight(kHeight),
|
| + decoration: const BoxDecoration(
|
| + backgroundColor: const sky.Color(0xFFFFFFFF),
|
| + border: const Border(
|
| + bottom: const BorderSide(
|
| + color: const sky.Color(0xFFF4F4F4),
|
| + width: 1.0))));
|
| }
|
| }
|
|
|