Basic Syntax of NestedScrollView Widget
NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
// SliverAppBar and/or other sliver widgets go here
return <Widget>[
// List of Sliver widgets
];
},
body: ListView(
// Body content goes here
),
)
Flutter – Nested Scroll View
In Flutter, you can use a NestedScrollView widget to create a scrollable view with multiple scrolling sections that can scroll independently of each other. This is commonly used when you have a header that should remain visible while the content below it scrolls. In this article, we are going to implement the NestedScrollView widget. A sample video is given below to get an idea about what we are going to do in this article.