I have a simple case, this is my layout:
ListView(
shrinkWrap: true,
children: [
Text("Row 1"),
Text("Row 2")
],
)
I want it to take only as much space in horizontal plane as its child widgets. Unfortunately, it expands to the whole width of the screen, which is the default behaviour of ListView.
Is there any way to make it take only as much space as necessary? The equivalent for Android would be wrap_content.
There are a lot of similar questions on this topic, but usually they are really looking for an alignment (so content aligned within their boundaries), whereas I'm looking for rows not taking all width (so having as small boundaries as possible).
Also I don't want to limit the size to some precise number, I want it to be flexible depending on the children width.