I am trying to make my main screen scrollable using SingleChildScrollView but it's not working as expected
here is my code:
SingleChildScrollView(
child: Column(
children: [
Row(...),
Container(
child: Column(
children: [
Text(...),
SizedBox(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemBuilder: (context, count) {
return Container(
height: 300,
child: Text("hi there $count"),
);
},
itemCount: 4,
),
)
],
),
)
],
),
);
change the column to list view
like this
SingleChildScrollView(
child: Column(
children: [
Row(...),
Container(
child: ListView(
children: [
Text(...),
SizedBox(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemBuilder: (context, count) {
return Container(
height: 300,
child: Text("hi there $count"),
);
},
itemCount: 4,
),
)
],
),
)
],
),
);
try this code
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.