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

Unified Diff: sky/sdk/example/stocks/lib/stock_list.dart

Issue 1219493003: Cleanup sky/sdk/examples (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | sky/sdk/example/stocks/lib/stock_menu.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/example/stocks/lib/stock_list.dart
diff --git a/sky/sdk/example/stocks/lib/stock_list.dart b/sky/sdk/example/stocks/lib/stock_list.dart
index c0fbe44ee07857c50a187cb050cd1365a07fc175..4b36783d186d25f5a0cd5920b5794a8a234cc844 100644
--- a/sky/sdk/example/stocks/lib/stock_list.dart
+++ b/sky/sdk/example/stocks/lib/stock_list.dart
@@ -2,22 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'package:sky/framework/components/fixed_height_scrollable.dart';
-import 'package:sky/framework/fn.dart';
+import 'package:sky/widgets/fixed_height_scrollable.dart';
+import 'package:sky/widgets/basic.dart';
+
import 'stock_data.dart';
import 'stock_row.dart';
class Stocklist extends FixedHeightScrollable {
- String query;
- List<Stock> stocks;
Stocklist({
- Object key,
+ String key,
this.stocks,
this.query
- }) : super(key: key);
+ }) : super(itemHeight: StockRow.kHeight, key: key);
+
+ String query;
+ List<Stock> stocks;
+
+ void syncFields(Stocklist source) {
+ query = source.query;
+ stocks = source.stocks;
+ super.syncFields(source);
+ }
- List<UINode> buildItems(int start, int count) {
+ List<Widget> buildItems(int start, int count) {
var filteredStocks = stocks.where((stock) {
return query == null ||
stock.symbol.contains(new RegExp(query, caseSensitive: false));
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | sky/sdk/example/stocks/lib/stock_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698