Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

listview builder doesn't take full height inside column

i am using listview.builder inside column widget, my column contains a text and then listview.builder widget (inside Sizedbox), the problem is i want to take full available height (according to device height) how can this be done?

enter image description here

 return Scaffold(
          backgroundColor: Colors.white,
          appBar: AppBar(
            backgroundColor: Colors.black,
            title: Text(
              'RAM FOOTBALL',
              style: GoogleFonts.anton(color: Colors.white),
            ),
          ),
          body: Column(
            children: [
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: Text(
                  'Matches',
                  style: GoogleFonts.anton(fontSize: 20),
                ),
              ),
              SizedBox(
                height: 500,
                child: ListView.builder()

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Just wrap that ListView with Expanded widget like the following:

 Column(
                children: [
                  Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Text(
                      'Matches',
                      style: GoogleFonts.anton(fontSize: 20),
                    ),
                  ),
                   Expanded(
                     child: ListView.builder()...
                        )
            ....

For sure, you now should remove that sized box.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading