SliverAppBar at the bottom of the screen (flutter)

2.5k views Asked by At

I don't know how to make a SliverAppBar at the bottom. I want it not to disappear when scrolling, I tried but it will show only on the bottom of the scroll.

2

There are 2 answers

1
JahidRatul On

Inside SliverAppBar Enable floating property true. For example:

CustomScrollView(
slivers: <Widget>[
 SliverAppBar(
   title: Text('Floating app bar'),
   // Allows the user to reveal the app bar if they begin scrolling back
   // up the list of items.
   floating: true,
   // Display a placeholder widget to visualize the shrinking size.
   flexibleSpace: Placeholder(),
   // Make the initial height of the SliverAppBar larger than normal.
   expandedHeight: 200,
 ),
],
);
0
Aquiko On

I did figure it out btw :D using this

bottomNavigationBar: BottomAppBar(
          child: Row(
            children: [
              IconButton(icon: Icon(Icons.menu), onPressed: () {}),
              Spacer(),
              IconButton(icon: Icon(Icons.search), onPressed: () {}),
              IconButton(icon: Icon(Icons.more_vert), onPressed: () {}),
            ],
          ),
        ),

inside of Scaffold

Sorry I thought SliverAppBar is same as all AppBar, NOOB here