我有一个“筛选器”,下面是一系列足球比赛。我用ListView包装“Filter”和“listview builder”(以解决blablabla下的重载写入问题)。但是当您正常滚动时,会出现一些奇怪的东西。无法滚动到列表。只有“发光效果”,但是如果我从上面的“筛选器菜单”滚动,滚动就可以工作。如何使滚动正常运行?
我的代码片段:
Widget _buildListView(FixtureModel model, BuildContext context) {
return Container(
child: model.getFixturesCount() == 0
? Center(child: Text('No fixtures found'))
: ListView(
shrinkWrap: true,
children: <Widget>[
Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
padding: EdgeInsets.only(left: 10.0),
child: InkWell(
onTap: () => _onTap(context),
child: Container(
margin:
EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Row(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: 5.0),
child:
Icon(FontAwesomeIcons.github)),
Container(
padding: EdgeInsets.only(left: 15.0),
child: Text(
'Liga Premier Inggris',
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w500),
),
),
Container(
padding: EdgeInsets.only(
left: 5.0, top: 2.0),
child: Icon(Icons.arrow_drop_down,
size: 17.0))
],
)),
)),
Container(
padding: EdgeInsets.only(top: 3.0),
child: Text(
'4',
style:
TextStyle(fontSize: 13.0, color: Colors.grey),
),
),
IconButton(
iconSize: 20.0,
icon: Icon(
FontAwesomeIcons.calendarAlt,
color: Colors.blue,
),
onPressed: () {})
],
),
Divider(
height: 0.0,
),
Container(
padding: EdgeInsets.only(top: 2.0),
child: ListView.builder(
shrinkWrap: true,
itemCount: model.fixtureList == null
? 0
: model.getFixturesCount(),
itemBuilder: (context, int i) {
var fixture = model.fixtureList[i];
return FixtureListItem(fixture: fixture);
},
))
],
)
],
));
}