My flutter app has a NestedScrollView
with a headerSliverBuilder
.
My SliverAppBar
inside this builder is like this:
SliverAppBar(
elevation: 0,
snap: true,
pinned: false,
floating: true,
forceElevated: false,
primary: false,
automaticallyImplyLeading: false,
backgroundColor: Colors.white,
expandedHeight: 65.0 + 75,
flexibleSpace: Container(
child: Column(children: <Widget>[
MyTabBar(true, 65, () {}, () {}),
Container(height: 75, color: Colors.orange)
]),
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Colors.black26,
blurRadius: 4.0,
spreadRadius: .0,
),
], color: Colors.white),
)
)
Now, when scrolling the behaviour is kind of weird. I'd like it to scroll away the whole SliverAppBar including everything in flexibleSpace
. But this is what happens:
It scrolls underneath the Orange part of my header and then scrolls away the tab-part above. And the moment the tab-part disappears, the orange part vanishes too. Huhh..
And the same when I get the bar back from scrolling down. Then the orange part just appears on the spot and the top part slides in. I'd like to have it all sliding in.
The whole behavior changed for me since the last flutter update.
Does anyone know what I need to do different to achieve my expected behavior?
Here is my full code of this simple example: https://github.com/nietsmmar/SliverHeaderTest/tree/master/flutter_app