Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add space between SliverAppBar and SliverList in Flutter

I have a SliverAppBar and below it, a SliverList.

The first SliverList item is too close to the SliverAppBar. I'd like to add some spacing between, whether via a bottom margin below the SliverAppBar or above the SliverList.

How can this be done?

like image 565
Dave Avatar asked Jan 27 '19 02:01

Dave


1 Answers

SliverPadding - wrap this widget around it.

your solution should look something like the this:

SliverPadding(
  padding: EdgeInsets.only(bottom: 8.0),
  sliver: SliverAppBar(...)
)

OR

SliverPadding(
  padding: EdgeInsets.only(top: 8.0),
  sliver: SliverList(...)
)
like image 67
Harsh Bhikadia Avatar answered Oct 19 '22 21:10

Harsh Bhikadia