Switch clients to ScrollGrid (#7752)

The only remaining client of ScrollableGrid (the old version) is Pesto,
which needs AppBar integration.
This commit is contained in:
Adam Barth
2017-02-01 11:01:02 -08:00
committed by GitHub
parent 41f1f8a489
commit fe01c71cf4
6 changed files with 44 additions and 38 deletions

View File

@@ -76,14 +76,14 @@ class AdaptiveContainer extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (MediaQuery.of(context).size.width < _kGridViewBreakpoint) {
return new ScrollableList(
return new ScrollView(
itemExtent: _kListItemExtent,
children: names.map((String name) => new AdaptedListItem(name: name))
children: names.map((String name) => new AdaptedListItem(name: name)).toList(),
);
} else {
return new ScrollableGrid(
delegate: new MaxTileWidthGridDelegate(maxTileWidth: _kMaxTileWidth),
children: names.map((String name) => new AdaptedGridItem(name: name))
return new ScrollGrid.extent(
maxCrossAxisExtent: _kMaxTileWidth,
children: names.map((String name) => new AdaptedGridItem(name: name)).toList(),
);
}
}