I'm trying to make my Main Screen fully scrollable, I've tried adding a SingleChildScrowView, a Column, wrap inside a ListView, but every single time there's some widget that throws an error or simply disappears, RenderFlex issues and etc. How could I make my screen scrollable, like a normal website?
Edit: My code is actually too big, but the body of my Scaffold is essentially like this:
Scaffold(
body: SafeArea(
child: Column(
children: <Widget>[
Container(
child: ....
),
Expanded(
child: ....
),
]
)
)
);
if you want to make a scrollable view then take a ListView Widget as Parent Widget and if you want to make some widgets with expanded vertically then use Column inside ListView or if you want to make Expanded in horizontal then take a Row widget see the code below and update accordingly as per your requirement, Hope the solution below helps you.
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
children: <Widget>[
Expanded(
child: ListView(
children: <Widget>[
Container(
color: Colors.amberAccent,
child: SizedBox(height: 400.0, width: MediaQuery.of(context).size.width,)
),
Container(
color: Colors.indigo,
child: SizedBox(height: 400.0, width: MediaQuery.of(context).size.width,)
),
Container(
color: Colors.amberAccent,
child: SizedBox(height: 400.0, width: MediaQuery.of(context).size.width,)
),
Container(
color: Colors.indigo,
child: SizedBox(height: 400.0, width: MediaQuery.of(context).size.width,)
),
Container(
color: Colors.amberAccent,
child: SizedBox(height: 400.0, width: MediaQuery.of(context).size.width,)
),
Container(
color: Colors.indigo,
child: SizedBox(height: 400.0, width: MediaQuery.of(context).size.width,)
),
],
),
),
],
)
)
);
}

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