Switch PageableList over to using RenderList

This patch moves PageableList off HomogeneousViewport and onto RenderList and
friends, making it match the new ScrollableList.
This commit is contained in:
Adam Barth
2016-01-06 15:13:40 -08:00
parent a271eb5612
commit e64d93a520
12 changed files with 179 additions and 173 deletions

View File

@@ -41,7 +41,7 @@ class PageableListAppState extends State<PageableListApp> {
ScrollDirection scrollDirection = ScrollDirection.horizontal;
bool itemsWrap = false;
Widget buildCard(BuildContext context, CardModel cardModel, int index) {
Widget buildCard(CardModel cardModel) {
Widget card = new Card(
color: cardModel.color,
child: new Container(
@@ -114,10 +114,9 @@ class PageableListAppState extends State<PageableListApp> {
}
Widget _buildBody(BuildContext context) {
return new PageableList<CardModel>(
items: cardModels,
return new PageableList(
children: cardModels.map(buildCard),
itemsWrap: itemsWrap,
itemBuilder: buildCard,
scrollDirection: scrollDirection
);
}