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
diff --git a/sky/examples/stocks-fn/stocksapp.dart b/sky/examples/stocks-fn/stocksapp.dart
index acba86f..0dd9b46 100644
--- a/sky/examples/stocks-fn/stocksapp.dart
+++ b/sky/examples/stocks-fn/stocksapp.dart
@@ -31,7 +31,12 @@
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 @@
new Container(
key: 'Content',
style: _style,
- children: [toolbar, new Stocklist(stocks: oracle.stocks)]
+ children: [toolbar, new Stocklist(stocks: _sortedStocks)]
),
fab,
drawer,