Dolphin
Dolphin

Reputation: 39055

how to make NestedScrollView did not have a header in flutter

I am now using NestedScrollView to show article list, this is the code I am using now:

return DefaultTabController(
      length: tabs.length,
      child: NestedScrollView(
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return <Widget>[
            SliverOverlapAbsorber(
                handle: NestedScrollView.sliverOverlapAbsorberHandleFor(
                  context,
                ),
                sliver: SliverAppBar(


                )),
          ];
        }}
)
)

is it possbile to remove the header headerSliverBuilder? when I am removed, it shows the headerSliverBuilder can not be null. But now I do not want a header in my app.

Upvotes: 1

Views: 1170

Answers (1)

Kishan Somaiya
Kishan Somaiya

Reputation: 202

Yes it's simple. You just have to do like this:

headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { return []; },

Upvotes: 3

Related Questions