skip to Main Content

How to do scroll screen with many widget.I want to use with carouselSlider, card, text and listTile widget.I used listview with gridview and i got error,i used gridView because i want to use card widget side by side and one after one other.
I have bad english, i am sorry

2

Answers


  1. A scrolling screen can be created using:

    return Scaffold(
       body: SingleChildScrollView(
           child: Column(
              children: [
                 //Put the widget code you want here.
              ],
           ),
       ),
    );
    

    I hope this answer helps you.

    Login or Signup to reply.
  2. Use ListView as parent and GridView as child with shrinkWrap true property like this

    ListView(
      children: [
        // First item in the ListView is a GridView
        GridView.count(
          shrinkWrap: true,
          crossAxisCount: 2,
          children: [
            Container(
              color: Colors.red,
              height: 50,
              width: 50,
            ),
            Container(
              color: Colors.blue,
              height: 50,
              width: 50,
            ),
            Container(
              color: Colors.green,
              height: 50,
              width: 50,
            ),
            Container(
              color: Colors.yellow,
              height: 50,
              width: 50,
            ),
          ],
        ),
        // Second item in the ListView is a simple ListTile
        ListTile(
          title: Text('Item 2'),
        ),
        // Third item in the ListView is another GridView
        GridView.count(
          shrinkWrap: true,
          crossAxisCount: 3,
          children: [
            Container(
              color: Colors.orange,
              height: 50,
              width: 50,
            ),
            Container(
              color: Colors.purple,
              height: 50,
              width: 50,
            ),
            Container(
              color: Colors.teal,
              height: 50,
              width: 50,
            ),
            Container(
              color: Colors.pink,
              height: 50,
              width: 50,
            ),
            Container(
              color: Colors.indigo,
              height: 50,
              width: 50,
            ),
            Container(
              color: Colors.brown,
              height: 50,
              width: 50,
            ),
          ],
        ),
        // Fourth item in the ListView is another ListTile
        ListTile(
          title: Text('Item 4'),
        ),
      ],
    );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search