Skip to main content

Row

The Row widget is a layout container that places its child widgets side by side horizontally.

Definition and role

The Row widget lays out the children it holds in a single line, from left to right. Set how those children align horizontally and vertically, and how much space sits between them.

  • Category: Layouts

Features

FeatureDescription
Horizontal layoutLines up child widgets in a single row, from left to right.
AlignmentSets the horizontal (main axis) and vertical (cross axis) alignment.
SpacingSets the spacing between children.

How to use

  1. Open the Layouts category in the left widget palette.
  2. Drag and drop the Row item onto the canvas.
  3. Place child widgets inside the Row.
  4. Adjust alignment and spacing with properties such as mainAxisAlignment, crossAxisAlignment, and spacing.

Properties

PropertyDescriptionDefaultValue / Type
mainAxisSizeHow the Row takes up horizontal spacemaxmin, max
mainAxisAlignmentHorizontal (main axis) alignmentstartstart, end, center, spaceBetween, spaceAround, spaceEvenly
crossAxisAlignmentVertical (cross axis) alignmentcenterstart, end, center, stretch, baseline
spacingSpacing between children0Number
textDirectionDirection of the horizontal layoutNot setrtl, ltr
verticalDirectionReference direction on the vertical axisdownup, down
textBaselineBaseline used for baseline alignmentNot setalphabetic, ideographic
clipBehaviorHow overflowing content is clippednonenone, hardEdge, antiAlias, antiAliasWithSaveLayer

Notes and tips

tip

To stretch a child into the leftover space, apply a Flexible or Expanded setting to that child. To fill the Row vertically, set crossAxisAlignment to stretch.

Learn more

tip

For the Widget Control you can use to script this widget, see Row Widget Control.