For this example, create a CustomScrollView that contains a
SliverAppBar and a SliverList. In addition, remove any app bars
that you provide to the Scaffold widget.

2. Use SliverAppBar to add a floating app bar

Next, add an app bar to the CustomScrollView.
Flutter provides the SliverAppBar widget which,
much like the normal AppBar widget,
uses the SliverAppBar to display a title,
tabs, images and more.

However, the SliverAppBar also gives you the ability to create a “floating”
app bar that scrolls offscreen as the user scrolls down the list.
Furthermore, you can configure the SliverAppBar to shrink and
expand as the user scrolls.

To create this effect:

Start with an app bar that displays only a title.

Set the floating property to true.
This allows users to quickly reveal the app bar when
they scroll up the list.