S.D.
S.D.

Reputation: 5857

How to keep AppBar at the top of the screen

Is there a way to prevent the appBar from remaining fixed on the top of the screen? I want the appBar to be static at the top of the screen, and be able to scroll it out of view.

For example, if there's a long list you wouldn't see the appBar always at the top of the screen when scrolling down the list.

return new Scaffold(
  appBar: new AppBar(..)
)

Upvotes: 1

Views: 3007

Answers (1)

Arnold Parge
Arnold Parge

Reputation: 6867

You can use SliverAppBar in CustomScrollView. There is a parameter pinned in SliverAppBar widget, which you can play around with it to achieve your desired output.

Happy Fluttering!

Upvotes: 7

Related Questions