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 1218593002: Move sky/examples to sky/sdk/lib/example, and code changes to support that change. Fixes T277. (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
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
deleted file mode 100644
index 4b36783d186d25f5a0cd5920b5794a8a234cc844..0000000000000000000000000000000000000000
--- a/sky/examples/stocks2/lib/stock_list.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-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 {
-
- Stocklist({
- String key,
- this.stocks,
- 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<Widget> buildItems(int start, int count) {
- var filteredStocks = stocks.where((stock) {
- return query == null ||
- stock.symbol.contains(new RegExp(query, caseSensitive: false));
- });
- itemCount = filteredStocks.length;
- return filteredStocks
- .skip(start)
- .take(count)
- .map((stock) => new StockRow(stock: stock))
- .toList(growable: false);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698