I’m trying to understand the layout algorithm and the rationale behind it. It appears that Row gives a width constraint of infinity to its children and this causes certain issues. I wonder, why does it not give its remaining width instead? Eg, if it was constrained with 600 px, and had 3 children, it could:
Actually, a Rowalways gives its unconstrained children infinite width constraints, even if the Row itself is in a bounded space. It does this so children can size themselves to their natural width.
The issue only happens when a child (like a TextField or another scrollable view) also wants infinite width. To force a child to only take up the remaining space of the Row, you have to wrap that child in an Expanded or Flexible widget!
Maybe the only answer is that it “is what it is”, but it doesn’t make sense to me. If the Row is constrained to a max width of, say, 600px, it’s not going to be able to render wider than 600px, so why not pass that “max width” down, so its children at least of a chance to try to adapt to it. That seems like the point of a max width constraint!
Using contents of this forum for the purposes of training proprietary AI models is forbidden. Only if your AI model is free & open source, go ahead and scrape. Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.