When I slide the Expanded(child: MusicListCardWidget()) part of the screen from the widgets in the column, the widgets at the top do not slide, but the entire screen needs to slide at once. How can I do this?
Scaffold(
body: Column(
children: [
SizedBox(height: 2.h,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("En son", style: TextStyles.plyListTextStyle(context)),
SizedBox(width: 2.w,),
Icon(Icons.auto_awesome_motion_rounded)
],
),
SizedBox(height: 2.h,),
Container(
//width: 60.h,
height: 30.h,
// color: Colors.black,
child: PageView(
controller: controller,
scrollDirection: Axis.horizontal
,children: [
MusicCardWidget(),
MusicCardWidget()
],
)
),
Expanded(child: MusicListCardWidget()),
],
),
);
2
Answers
Use a SingleChildScrollView:
If you want it to scroll up-down, you’ll need a Scrollable view, but it will conflict with the expanded, because it would try to expand to the infinity,
Adding a
SingleChildScrollView
and removing the expanded, should look like this: