Ask the assistant
0/400
Your question is processed by an AI service and kept to improve answers. Do not enter personal data.

    Wrap

    Lays out its children in a row or column and wraps them onto the next line when they overflow.

    Type: multi-child

    Wrap spacing:8 runSpacing:8
      SizedBox width:100 height:40
        ColoredBox color:#6C63FF
      SizedBox width:100 height:40
        ColoredBox color:#585593
      SizedBox width:100 height:40
        ColoredBox color:#36345E

    Parameters

    Parameter Type Default Description
    direction string horizontal Direction: horizontal , vertical
    alignment string start Alignment along the main axis: start , end , center , spaceBetween , spaceAround , spaceEvenly
    spacing double 0 Space between elements
    runAlignment string start Alignment of the lines: start , end , center , spaceBetween , spaceAround , spaceEvenly
    runSpacing double 0 Space between lines
    crossAxisAlignment string start Alignment along the cross axis within a line: start , end , center
    textDirection string — Text direction: ltr , rtl
    verticalDirection string down Direction of the lines: down , up
    clipBehavior string none Clipping: none , hardEdge , antiAlias , antiAliasWithSaveLayer

    Examples

    Tags / chips

    Wrap spacing:8 runSpacing:8
      DecoratedBox
        #decoration color:#6C63FF
          #borderRadius circular 16
        Padding
          #padding symmetric horizontal:12 vertical:6
          Text "Action"
      DecoratedBox
        #decoration color:#585593
          #borderRadius circular 16
        Padding
          #padding symmetric horizontal:12 vertical:6
          Text "Sci-fi"
      DecoratedBox
        #decoration color:#36345E
          #borderRadius circular 16
        Padding
          #padding symmetric horizontal:12 vertical:6
          Text "Drama"

    See also

    • Row — horizontal layout without wrapping
    • Column — vertical layout without wrapping