Search code examples
flutterdartflutter-layout

Remove SliverAppBar bottom border - Flutter


enter image description here

I wanna remove the border that I highlighted in the above picture. I couldn't find any solution to fix this :(

here is my SliverAppBar Code :

NestedScrollView(
        headerSliverBuilder: (BuildContext ctx, isScrolled) {
            return <Widget>[
               SliverAppBar(
                  title: Text('Applying to this job opportunity'),
                  pinned: true,
                  titleSpacing: 0,
                  floating: true,
                  expandedHeight: 180,
                  flexibleSpace: //some widgets
             )
        ]
    }
)

Solution

  • Just set the elevation property to 0.

     SliverAppBar(
                      title: Text('Applying to this job opportunity'),
                      pinned: true,
                      elevation: 0,
                      titleSpacing: 0,
                      floating: true,
                      expandedHeight: 180,
                      flexibleSpace: //some widgets
                 )
    

    More info : https://api.flutter.dev/flutter/material/SliverAppBar/elevation.html