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

    Expanded

    Stretches its child over all the available space inside a Row or Column.

    Type: single-child

    Row
      Expanded
        Text "Takes all the space"
      Icon arrow_forward_ios

    Parameters

    Parameter Type Default Description
    flex int 1 Stretch factor relative to other Expanded elements in the same container

    Examples

    Even distribution

    Row
      Expanded
        Text "Left part"
      Expanded
        Text "Right part"

    Uneven distribution

    Column
      Expanded flex:2
        ColoredBox color:#36345E
          Center
            Text "Top (2/3)"
      Expanded flex:1
        ColoredBox color:#585593
          Center
            Text "Bottom (1/3)"

    Best practices

    • Used only as a direct child of a Row or Column
    • With equal flex values the space is split evenly

    See also

    • Row — a horizontal container
    • Column — a vertical container
    • Spacer — an invisible flexible gap (like Expanded without content)