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

Create ListView Flutter

im new in flutter , and im trying to create a listView Like this photo in my app:
Description flutter

this is my code :

return Scaffold(
      body: Container(
        child: Column(
          children: <Widget>[
            Align(
              alignment: Alignment.topRight,
              child: Container(
                child: const Text(
                  ':الآن',
                  style: TextStyle(
                    fontSize: 20,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
            ),
            const SizedBox(
              height: 4,
            ),
            Align(
                alignment: Alignment.center,
                child: Card(
                  semanticContainer: true,
                  clipBehavior: Clip.antiAliasWithSaveLayer,
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(10.0),
                  ),
                  elevation: 5,
                  margin: const EdgeInsets.all(8),
                  child: Image.asset(
                    'assets/aire.jpeg',
                    fit: BoxFit.fill,
                  ),
                )),
            const SizedBox(
              height: 4,
              
            ),
            Align(
              alignment: Alignment.topRight,
              child: Container(
                child: const Text(
                  ':آخر الأخبـار',
                  style: TextStyle(
                    fontSize: 20,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );

My probleme is when i use the ListView.builder , Or ListTitle , all the views in the top disappear.
how can i solve it , Thanks

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 :

Wrap your ListView with Expanded to get available height inside column.

  body: Container(
    child: Column(
      children: <Widget>[
    .....
          Expanded(
             child: ListView( ...

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