I have the following code to generate the ListView:
Padding(
padding: const EdgeInsets.only(top:30),
child: RefreshIndicator(
child: SizedBox(
height:MediaQuery.of(context).size.height,
child: model.state == ViewState.Busy ? const Center(child: CircularProgressIndicator()) : ListView.builder(
itemCount: model.farmerList.length,
itemBuilder: (_,index)
{
return Padding(
(Interior del list view)
),
)
and the Body is as follows:
body: SingleChildScrollView(
reverse: false,
child: Column(
children: [
Container(
margin: const EdgeInsets.symmetric(vertical: 15, horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
As you can see in the list view I am using MediaQuery
, which I understand should take up all the available space, however, the list view stretches to infinity. I think this happens because in the body I have a SingleChildScrollView
, however, when I remove the latter, I get an overflow of several pixels (depending on the size of the list), and I don't understand why.
I know this has been asked many times, but I can't find the solution even looking at the answers, or I don't know exactly what to do.