diff --git a/examples/stocks/lib/stock_list.dart b/examples/stocks/lib/stock_list.dart index 2e6e5bbf1d9..78a8d64c6b4 100644 --- a/examples/stocks/lib/stock_list.dart +++ b/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 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; + return filteredStocks .skip(start) .take(count) .map((stock) => new StockRow(stock: stock))