24

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?

Harsh Bhikadia
  • 10,095
  • 9
  • 49
  • 70
Dave
  • 28,833
  • 23
  • 113
  • 183

1 Answers1

54

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(...)
)
Giacomo M
  • 4,450
  • 7
  • 28
  • 57
Harsh Bhikadia
  • 10,095
  • 9
  • 49
  • 70