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

Unified Diff: sky/examples/stocks2/lib/stock_list.dart

Issue 1174023003: Remove one more use of mirrors: Components now have to explicitly sync their fields. (Closed) Base URL: https://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/examples/stocks2/lib/stock_arrow.dart ('k') | sky/examples/stocks2/lib/stock_menu.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks2/lib/stock_list.dart
diff --git a/sky/examples/stocks2/lib/stock_list.dart b/sky/examples/stocks2/lib/stock_list.dart
index 58fa601ba9decca16f4fbf7f092a487241381fcc..7ff6fe8cb75f4d4809cee722c800992885b3fa7f 100644
--- a/sky/examples/stocks2/lib/stock_list.dart
+++ b/sky/examples/stocks2/lib/stock_list.dart
@@ -8,8 +8,6 @@ import 'stock_data.dart';
import 'stock_row.dart';
class Stocklist extends FixedHeightScrollable {
- String query;
- List<Stock> stocks;
Stocklist({
Object key,
@@ -17,6 +15,15 @@ class Stocklist extends FixedHeightScrollable {
this.query
}) : 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) {
var filteredStocks = stocks.where((stock) {
return query == null ||
« no previous file with comments | « sky/examples/stocks2/lib/stock_arrow.dart ('k') | sky/examples/stocks2/lib/stock_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698