Files
flutter/examples/stocks/lib/stock_list.dart
2015-10-19 12:11:10 -07:00

28 lines
762 B
Dart

// 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.
part of stocks;
class StockList extends StatelessComponent {
StockList({ Key key, this.stocks, this.onOpen, this.onAction }) : super(key: key);
final List<Stock> stocks;
final StockRowActionCallback onOpen;
final StockRowActionCallback onAction;
Widget build(BuildContext context) {
return new ScrollableList<Stock>(
items: stocks,
itemExtent: StockRow.kHeight,
itemBuilder: (BuildContext context, Stock stock) {
return new StockRow(
stock: stock,
onPressed: onOpen,
onLongPressed: onAction
);
}
);
}
}