-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
I want to add some custom dropdown controls below the title text in the SliverAppBar
. There is no clean way to do this currently.
I have a SliverAppBar
that contains a FlexibleSpaceBar
with a cover image, a drawer, and some title text.
I tried adding these controls to the FlexibleSpaceBar
, by hijacking background
with a Column
widget, but clearly the layout was not designed for this, and it's pretty much impossible to get the layout and animation right.
I added a SliverPersistentHeader
, which does place the controls below the SliverAppBar
, but there are several issues:
- Really I just want the extra controls in the
SliverPersistentHeader
to appear as part of theSliverAppBar
, not have their own hide/show semantics that are different from those of theSliverAppBar
. - The pinning/floating behavior of
SliverPersistentHeader
is bizarre at best -- I want this header to appear whenever theSliverAppBar
is maximized and I drag down, at any position in the wrappingCustomScrollView
. However,SliverPersistentHeader
seems to pin at an absolute position near the top of theCustomScrollView
, so it only appears if I scroll theCustomScrollView
nearly to the top. Seefloating
behavior ofSliverPersistentHeader
does not match that ofSliverAppBar
#129869. - There is a tiny half-pixel gap between the
SliverAppBar
and theSliverPersistentHeader
. This shows up as a faint white line occasionally, since both the app bar and the header have non-white backgrounds. See There is a half-pixel gap betweenSliverAppBar
andSliverPersistentHeader
#129870.
Proposal
Please add a SliverAppBar.footer
field that allows the user to add a Widget
to the bottom of the SliverAppBar
.
It would also be great if this footer were dyamically-sizeable, so that content could be added to or removed from it, and it would take only as much vertical space as necessary to wrap the content.