Commit a2ce9483 authored by Hans Muller's avatar Hans Muller

Replace Block with ScrollableList in Cards demo (#3380)

parent 1c0a9663
...@@ -41,8 +41,10 @@ class TravelDestinationItem extends StatelessWidget { ...@@ -41,8 +41,10 @@ class TravelDestinationItem extends StatelessWidget {
assert(destination != null && destination.isValid); assert(destination != null && destination.isValid);
} }
static final double height = 328.0;
final TravelDestination destination; final TravelDestination destination;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ThemeData theme = Theme.of(context); ThemeData theme = Theme.of(context);
...@@ -50,9 +52,9 @@ class TravelDestinationItem extends StatelessWidget { ...@@ -50,9 +52,9 @@ class TravelDestinationItem extends StatelessWidget {
TextStyle descriptionStyle = theme.textTheme.subhead; TextStyle descriptionStyle = theme.textTheme.subhead;
TextStyle buttonStyle = theme.textTheme.button.copyWith(color: theme.primaryColor); TextStyle buttonStyle = theme.textTheme.button.copyWith(color: theme.primaryColor);
return new Card( return new SizedBox(
child: new SizedBox( height: height,
height: 328.0, child: new Card(
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
// photo and title // photo and title
...@@ -122,7 +124,8 @@ class CardsDemo extends StatelessWidget { ...@@ -122,7 +124,8 @@ class CardsDemo extends StatelessWidget {
appBar: new AppBar( appBar: new AppBar(
title: new Text('Travel stream') title: new Text('Travel stream')
), ),
body: new Block( body: new ScrollableList(
itemExtent: TravelDestinationItem.height,
padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0), padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
children: destinations.map((TravelDestination destination) { children: destinations.map((TravelDestination destination) {
return new Container( return new Container(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment