From a2ce9483c19933be272db9f36b7429faa5d59d7f Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Tue, 19 Apr 2016 09:45:53 -0700 Subject: [PATCH] Replace Block with ScrollableList in Cards demo (#3380) --- examples/material_gallery/lib/demo/cards_demo.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/material_gallery/lib/demo/cards_demo.dart b/examples/material_gallery/lib/demo/cards_demo.dart index 4d0fcf67c0..f8ca31caaf 100644 --- a/examples/material_gallery/lib/demo/cards_demo.dart +++ b/examples/material_gallery/lib/demo/cards_demo.dart @@ -41,8 +41,10 @@ class TravelDestinationItem extends StatelessWidget { assert(destination != null && destination.isValid); } + static final double height = 328.0; final TravelDestination destination; + @override Widget build(BuildContext context) { ThemeData theme = Theme.of(context); @@ -50,9 +52,9 @@ class TravelDestinationItem extends StatelessWidget { TextStyle descriptionStyle = theme.textTheme.subhead; TextStyle buttonStyle = theme.textTheme.button.copyWith(color: theme.primaryColor); - return new Card( - child: new SizedBox( - height: 328.0, + return new SizedBox( + height: height, + child: new Card( child: new Column( children: [ // photo and title @@ -122,7 +124,8 @@ class CardsDemo extends StatelessWidget { appBar: new AppBar( 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), children: destinations.map((TravelDestination destination) { return new Container(