Setting container width automatically in flutter

Viewed 27

I am loading data from Api. So I need to set it inside a container. So I can't set a fixed width. The width should change automatically or expand according to the length of data. Is there any way to do this?

2 Answers

Wrap your container with the Expanded widget.

Just one add to Mansoor's answer Malik you can assign a minWidth in constraints. To make the container appear even if there is no text inside it

Related