Given some List<Widget>
, how might I achieve the equivalent of CSS float left/right? I have a list of widgets with constant height, but variable width. I would like for them to be laid out like the image:
Widgets are moved by setting the alignment with Alignment , which has static properties like topCenter, bottomRight, and so on. Or you can take full control and set Alignment(1.0, -1.0) , which takes x,y values ranging from 1.0 to -1.0, with (0,0) being the center of the screen.
What you're looking for is Wrap widget.
new Wrap(
direction: Axis.horizontal,
crossAxisAlignment: WrapCrossAlignment.start,
spacing: 5,
runSpacing: 5,
children: [
],
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With