mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Replace Block with ScrollableList in Cards demo (#3380)
This commit is contained in:
parent
1c0a966384
commit
a2ce9483c1
@ -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 {
|
|||||||
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 {
|
|||||||
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(
|
||||||
|
Loading…
Reference in New Issue
Block a user