Sort the stocks displayed in stocks-fn as per Material Design

http://www.google.com/design/spec/components/lists.html#lists-behavior

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/993093004
This commit is contained in:
Eric Seidel
2015-03-10 14:55:49 -07:00
parent a8891ed07e
commit 7e9bbbec21

View File

@@ -31,7 +31,12 @@ class StocksApp extends App {
margin: 0 4px;'''
);
StocksApp() : super();
List<Stock> _sortedStocks;
StocksApp() : super() {
_sortedStocks = oracle.stocks;
_sortedStocks.sort((a, b) => a.symbol.compareTo(b.symbol));
}
Node build() {
var drawer = new Drawer(
@@ -93,7 +98,7 @@ class StocksApp extends App {
new Container(
key: 'Content',
style: _style,
children: [toolbar, new Stocklist(stocks: oracle.stocks)]
children: [toolbar, new Stocklist(stocks: _sortedStocks)]
),
fab,
drawer,