Reputation: 597
My Column won't scroll when using this piece of code:
Flexible(
child: new ListView(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
children: <Widget>[
CarsList(uid: widget.uid),
MotorbikeList(uid: widget.uid)
],
)
),
When I wrap them individually into Flex Widget I can then scroll through them but they are not using the entire space of the column when expanded.
Flexible(
child: CarsList(uid: widget.uid),
),
Flexible(
child: MotorbikeList(uid: widget.uid),
)
[
Upvotes: 2
Views: 4384
Reputation: 2510
Try this code:
Flexible(
child: new ListView(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
children: <Widget>[
Expanded(
child: CustomScrollView(slivers: <Widget>[
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
CarsList(uid: widget.uid),
MotorbikeList(uid: widget.uid)
},
childCount: 2,
),
),
])),
],
));
Upvotes: 4