Add support for scrollable grids

We now support (vertically) scrollable grids with viewporting. If the
scroll doesn't reveal any new rows, we execute the scroll with a repaint
(i.e., no layout). If the scroll reveals a new row, we trigger a layout
to change the set of materialized children in the viewport.
This commit is contained in:
Adam Barth
2016-01-04 00:25:44 -08:00
parent 35b18c3def
commit 6106fa9d6d
7 changed files with 348 additions and 23 deletions

View File

@@ -76,13 +76,9 @@ class MediaQueryExample extends StatelessComponent {
items.map((AdaptiveItem item) => item.toListItem()).toList()
);
} else {
return new Block(
<Widget>[
new MaxTileWidthGrid(
items.map((AdaptiveItem item) => item.toCard()).toList(),
maxTileWidth: _maxTileWidth
)
]
return new ScrollableGrid(
children: items.map((AdaptiveItem item) => item.toCard()).toList(),
delegate: new MaxTileWidthGridDelegate(maxTileWidth: _maxTileWidth)
);
}
}