blob: 883ee378692fea73a09aa48d8e472cedb4306396 [file] [log] [blame]
part of stocksapp;
class Stocklist extends FixedHeightScrollable {
String query;
List<Stock> stocks;
Stocklist({
Object key,
this.stocks,
this.query
}) : super(key: key, scrollCurve: new OverscrollCurve());
List<Node> buildItems(int start, int count) {
return stocks
.skip(start)
.where((stock) => query == null || stock.symbol.contains(
new RegExp(query, caseSensitive: false)))
.take(count)
.map((stock) => new StockRow(stock: stock))
.toList(growable: false);
}
}