Search code snippets, questions, articles...

Use ListView.builder with other widgets in scroll area Flutter

SingleChildScrollView(
    physics: ScrollPhysics(),
    child: Column(
        children: <Widget>[
            Container(
                color: Color(0xffFFFFFF),
                child: Text('Hello Wold')
            ),
            ListView.builder(
                physics: NeverScrollableScrollPhysics(),
                itemCount:18,
                itemBuilder: (context,index){
                    return  Text('Some text');
            })
        ],
    ),
),

SingleChildScrollView can be used to use multiple widgets with scrolling enabled. If you want to use ListView.builder along with other widgets like you want to add a heading before ListView you can use SingleChildScrollView widget.

In the code snippet, we have passed physics property that will help the smooth scrolling on devices. You can pass as many widgets as its children to render inside the scroll area.

Search Index Data (The code snippet can also be found with below search text)

Use multiple widgets in scroll area flutter
Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet