I put ListView
inside SingleChildScrollView
and listview inside Wrap
so i want to make listview scroll with SingleChildScrollView this is the listView
Padding(
padding: EdgeInsets.only(top: 10.0 ,right: 30.0 , left: 30.0),
child: Center(
child: Wrap(
children: <Widget>[
Container(
child:ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: items.length,
itemBuilder: (context,index){
return Align(
child: Container(
padding: EdgeInsets.only(top: 20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Padding(
padding: EdgeInsets.only(right: 5,top: 0),
child: Image.asset(
items[index].img,
width: 60.0,
height: 60.0,
),
),
),
Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Container(
width: 200.0,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: const Radius.circular(50.0),
topRight: const Radius.circular(50.0),
bottomLeft: const Radius.circular(50.0),
bottomRight: const Radius.circular(50.0),
),
),
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children:[
Padding(
padding: const EdgeInsets.all(20.0),
child: Center(
child: Text(
items[index].name,
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 25.0
),
),
),
)
],
),
)
),
],
),
),
);
},),
Add physics
as NeverScrollableScrollPhysics
which will stop ListView
Scrolling and will take SingleChildScrollView
Scroll.
ListView.builder(
physics: NeverScrollableScrollPhysics(),
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.