Flutter: Dynamic SliverAppBar: No need to set the height anymore!

Опубликовано: 04 Август 2026
на канале: Abel Does Flutter
4,931
33

The SliverAppBar sliver offers an expandable effect on scroll and we need to specify the maximum height of the sliver widget. There are situations where we want to have an expandable widget and we want the maximum height of the expanded widget to be the height of the widget itself. Then, I found a tricky solution to achieve the latter. I hope it can be as useful to you as it was to me.

https://github.com/Abel1027/dynamic_a...

El sliver SliverAppBar ofrece un efecto expansible durante el scrolling y necesitamos especificar la altura máxima del widget flexible. Hay situaciones en las que queremos tener un widget expansible y queremos que la altura máxima del widget expandido sea la altura del propio widget. Para ello, encontré una solución alternativa. Espero que pueda ser útil para ti como lo fue para mi.