How to Make a Container’s Height Adjust Dynamically to Its Content in FlutterFlow?

Integrations

Hey everyone,

I'm trying to create a dynamic height container for posts in my app. The goal is for the container to automatically adjust based on the content inside it. Here’s what I need:

  • If a user writes only text, the container should adjust to fit just the text.

  • If a user adds an image, the container should expand accordingly.

  • The height should not be fixed but should resize dynamically.

What’s the best approach to make the container height fully dynamic based on its content? Would really appreciate any advice!

Thanks! 😊

What have you tried so far?
  1. Cannot Leave Height Empty – When I try to leave the height field blank, FlutterFlow resets it to a previous value.

  2. Container Doesn't Resize – Even when I set the height to null (or try wrapping it in a Column), the container doesn’t always adjust correctly.

Did you check FlutterFlow's Documentation for this topic?
Yes
1
2 replies