I got a SliverAppBar
with an AnimatedContainer
inside. The height of this animated container changes on runtime, so the container animates its resizing. My problem is, that the expandedHeight
of my SliverAppBar is fix. But this needs to resize analog to my animated Container.
Is there a way to set the SliverAppBar to "height is always according to child" or something like that? The AnimatedContainer has no callback which gives me every change while it animates the resizing. If there would be such a callback I could change the expandedHeight
attribute of the SliverAppBar accordingly by myself.
Any idea how to fix my problem? Thanks!
return SliverAppBar(
elevation: 0,
snap: true,
pinned: false,
floating: true,
forceElevated: false,
primary: false,
automaticallyImplyLeading: false,
backgroundColor: Colors.white,
expandedHeight: _eHeight,
flexibleSpace: Column(children: <Widget>[
AnimatedContainer(
onEnd: onTopBarsAnimationEnd,
height: _trending
? _tabBarHeight: _tabBarHeight + topicsHeight,
duration: Duration(milliseconds: 800),
curve: Curves.fastOutSlowIn,
child: // some child
)
]
)
)