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

Unified Diff: sky/examples/stocks-fn/stocksapp.dart

Issue 993093004: Sort the stocks displayed in stocks-fn as per Material Design (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks-fn/stocksapp.dart
diff --git a/sky/examples/stocks-fn/stocksapp.dart b/sky/examples/stocks-fn/stocksapp.dart
index acba86f07af30718cc506df17e0d4fbccbb28373..0dd9b46e27964fe3e38ab6c3b61f719c05946a04 100644
--- a/sky/examples/stocks-fn/stocksapp.dart
+++ b/sky/examples/stocks-fn/stocksapp.dart
@@ -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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698