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

    SizedBox

    A box with fixed dimensions. Has several constructors for common cases.

    Type: single-child

    SizedBox width:200 height:100
      ColoredBox color:#36345E

    SizedBox

    Parameter Type Description
    width double Width
    height double Height

    SizedBox.square

    A square box.

    SizedBox.square dimension:48
      Icon play_arrow
    Parameter Type Description
    dimension double Side length of the square

    SizedBox.expand

    Takes all the space available from the parent.

    SizedBox.expand
      ColoredBox color:#36345E

    SizedBox.shrink

    Minimal size (0×0). Used as a placeholder.

    SizedBox.shrink

    Examples

    Gap between elements

    Column
      Text "First"
      SizedBox height:20
      Text "Second"

    Box for an image

    SizedBox width:512 height:288
      ClipRRect
        #borderRadius circular 20
        Image src:"https://example.com/poster.jpg" fit:cover

    See also

    • Spacer — flexible gap in a Row/Column
    • Expanded — stretches to the available space