Horizontal box changing size of children

when I use the Horizontal box, it changes the size of the children. How do I prevent that from happening? I just want to use the horizontal box to change the spacing between the children, so that it automatically fits the spacing to the available screen space. the size however should NOT be changed.
The very left item is in the horizontal box, while the ones on the right to it aren’t yet. the one on the left should look like the one ones on the right, but it’s getting squashed for some reason.

That’s pretty normal, widgets do not control their own size, it’s controlled by the parent, and affected by alignment settings.

To prevent it, wrap elements with a SizeBox - it has size override settings. Any container trying to alter children widgets’ dimensions will need to deal with the SizeBox first.

that somewhat works, but now the issue is that it still resizes the children.

280855-61.png

All I want it to do is to change the padding between the children, but always keep the same size. Or at least have it keep the aspect ration.

figure it out. I ended up using the overlay instead of the Horizontal box. the Overlay respected the desired size and aspect ratio. Exactly what I needed

The thing with containers is they have slightly different rules and it’s just a matter of experimenting what works best for certain scenarios. Some containers come with extra slot functionality (wrap box) allowing you to specify padding directly for the slot itself.

But you can, of course, include the padding in the child itself instead.

Glad to hear you’ve worked it out, good luck with the rest!