flutterlayoutstackrebuild

Flutter: Make [Stack] lay out its children like [Colum]


Is it possible to have a [Stack] that lays out its children like a [Column]?

The issue: A [SizeTransition] inside a [Column] rebuilds it whenever the animation is fired. With a [Stack], everything works as expected.


Solution

  • Not seeing the code, I'll conjecture on a couple things:

    1. if the size of the animation container, particularly height changes with the animation, the whole column will need to rebuild. So set a fixed height for the container of your animation.
    2. Then just put that animation in its own Stateful Widget. It should rebuild independently within the column, not rebuilding the column.

    I'm betting that the column rebuilds because height of animation container is changing.