I have a 'Filter' and below that is a list of soccer matches. I Wrap 'Filter and' listview builder' with a ListView (so that the overload writing under blablabla is resolved). But there is something strange when you scroll normally. scroll to the list that doesn't work. there is only a 'glow effect', but I scroll from the 'Filter menu' above, the scroll works. How do I make the scroll run normally?
My snipped code:
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);
},
))
],
)
],
));
}
In your ListView add:
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
To take Out Filter From ListView: remove physics: NeverScrollableScrollPhysics(), then in ListView
body: Column(
children: <Widget>[
Filter(),
Expanded(
child: ListView()
),
]
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With