0

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

0

1 Answer 1

2

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

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.