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

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

Issue 1097373002: [Effen] Prevent scrolling past the bottom of a scrollable list. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Move the creation of the OverscrollBehavior class to FixedHeightScrollable, since we already assumeā€¦ Created 5 years, 8 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/framework/animation/mechanics.dart » ('j') | sky/framework/animation/mechanics.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/stocks/lib/stock_list.dart
diff --git a/sky/examples/stocks/lib/stock_list.dart b/sky/examples/stocks/lib/stock_list.dart
index 2e6e5bbf1d9db5e92f85d7b4edcb8dd200bc0f48..78a8d64c6b490c0c5962da26a99e2340dc0e9d67 100644
--- a/sky/examples/stocks/lib/stock_list.dart
+++ b/sky/examples/stocks/lib/stock_list.dart
@@ -16,12 +16,15 @@ class Stocklist extends FixedHeightScrollable {
Object key,
this.stocks,
this.query
- }) : super(key: key, scrollBehavior: new OverscrollBehavior());
+ }) : super(key: key);
List<UINode> buildItems(int start, int count) {
- return stocks
- .where((stock) => query == null || stock.symbol.contains(
- new RegExp(query, caseSensitive: false)))
+ var filteredStocks = stocks.where((stock) {
+ return query == null ||
+ stock.symbol.contains(new RegExp(query, caseSensitive: false));
+ });
+ itemCount = filteredStocks.length;
abarth-chromium 2015/06/04 16:23:17 Won't this |length| query force the filter to be e
+ return filteredStocks
.skip(start)
.take(count)
.map((stock) => new StockRow(stock: stock))
« no previous file with comments | « no previous file | sky/framework/animation/mechanics.dart » ('j') | sky/framework/animation/mechanics.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698