IBlackVikingl
IBlackVikingl

Reputation: 1243

Flutter: SliverAppBar disable scrolling

I have SliverAppBar in my app with expandedHeight: 200,. Below it i have ListView that display content dynamically and can have different length. If ListView has 7 or more item its works perfecly, but if its below 7 items SliverAppBar still scrolls and has a lot of black space(screenshot). How can i disable SliverAppBar scroll property? I tried to use physics: NeverScrollableScrollPhysics(), in ListView itself, it didn't help.

enter image description here

Upvotes: 2

Views: 3413

Answers (1)

Miguel Ruivo
Miguel Ruivo

Reputation: 17746

Assuming you have a the SliverAppBar in a CustomScrollView or similar, you'll need to set the physics to NeverScrollableScrollPhysics() there as well.

Upvotes: 3

Related Questions