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

Unified Diff: sky/examples/stocks-fn/lib/stock_app.dart

Issue 1021723005: Load stocks data off the network (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 | sky/examples/stocks-fn/lib/stock_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks-fn/lib/stock_app.dart
diff --git a/sky/examples/stocks-fn/lib/stock_app.dart b/sky/examples/stocks-fn/lib/stock_app.dart
index c2ef40d7a4f955f612bee3910aba6760e15709fc..0331b5233ad5f067ea059e0f49415f520535cb98 100644
--- a/sky/examples/stocks-fn/lib/stock_app.dart
+++ b/sky/examples/stocks-fn/lib/stock_app.dart
@@ -33,14 +33,18 @@ class StocksApp extends App {
${typography.white.title};'''
);
- List<Stock> _sortedStocks;
+ List<Stock> _sortedStocks = [];
bool _isSearching = false;
bool _isShowingMenu = false;
String _searchQuery;
StocksApp() : super() {
- _sortedStocks = oracle.stocks;
- _sortedStocks.sort((a, b) => a.symbol.compareTo(b.symbol));
+ fetchStockOracle().then((oracle) {
+ setState(() {
+ _sortedStocks = oracle.stocks;
+ _sortedStocks.sort((a, b) => a.symbol.compareTo(b.symbol));
+ });
+ });
}
void _handleSearchClick(_) {
« no previous file with comments | « no previous file | sky/examples/stocks-fn/lib/stock_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698