How do you align widgets like CSS float with Flutter UI?

6,845

What you're looking for is Wrap widget.

new Wrap(
    direction: Axis.horizontal,
    crossAxisAlignment: WrapCrossAlignment.start,
    spacing: 5,
    runSpacing: 5,
    children: [
    ],
);
Share:
6,845
Author by

R. C. Howell

Updated on November 22, 2022

Comments

  • R. C. Howell about 1 month

    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:

    enter image description here

  • sjsam
    sjsam over 2 years
    Indeed, this what I was also looking for!