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:
@@ -310,9 +310,6 @@ class GridListDemoState extends State<GridListDemo> {
|
||||
});
|
||||
}
|
||||
|
||||
// When the ScrollableGrid first appears we want the last row to only be
|
||||
// partially visible, to help the user recognize that the grid is scrollable.
|
||||
// The GridListDemoGridDelegate's tileHeightFactor is used for this.
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Orientation orientation = MediaQuery.of(context).orientation;
|
||||
|
||||
@@ -203,14 +203,12 @@ class GridLists {
|
||||
// START gridlists
|
||||
// Creates a scrollable grid list with images
|
||||
// loaded from the web.
|
||||
new ScrollableGrid(
|
||||
delegate: new FixedColumnCountGridDelegate(
|
||||
columnCount: 3,
|
||||
tileAspectRatio: 1.0,
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
columnSpacing: 4.0,
|
||||
rowSpacing: 4.0
|
||||
),
|
||||
new ScrollGrid.count(
|
||||
crossAxisCount: 3,
|
||||
childAspectRatio: 1.0,
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
mainAxisSpacing: 4.0,
|
||||
crossAxisSpacing: 4.0,
|
||||
children: <String>[
|
||||
'https://example.com/image-0.jpg',
|
||||
'https://example.com/image-1.jpg',
|
||||
@@ -224,7 +222,7 @@ new ScrollableGrid(
|
||||
),
|
||||
child: new Image.network(url, fit: ImageFit.cover)
|
||||
);
|
||||
})
|
||||
}).toList(),
|
||||
);
|
||||
// END
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user