Column

The Column widget arranges its child widgets vertically. It's commonly used to display multiple widgets, one below the other. For example, you might use this widget to show text, an image, and a button placed vertically in your app:

Here’s how the column arranges its children:

Add Column widget

To add a Column widget:

  1. Open the Widget Palette and locate the Column widget under the Layout Elements tab. You can drag it into your desired location or add it directly from the widget tree.

  2. Add a few widgets inside the Column. You'll see them neatly lined up in a vertical arrangement.

Customizing

You can customize the appearance and behavior of this widget using the various properties available under the properties panel.

Changing Main Axis Size

For a Column, the Main Axis runs vertically, and the Cross Axis runs horizontally. By default, all the children inside the column will be arranged in a vertical fashion.

The Main Axis Size defines how much space a Column should occupy in the main axis (i.e., vertical direction).

You can set the main axis size using the following two options:

Adjust the Main Axis Alignment

The Main Axis for a Column widget is the vertical axis, so adjusting this will change how the child widgets are vertically distributed in the column.

You can adjust the main axis alignment using the following options:

  1. Start: Aligns children at the top of the column.

  2. Center: Centers children within the column.

  3. End: Aligns children at the bottom of the column.

  4. Space Evenly: Distributes children evenly, with equal spacing throughout.

  5. Space Around: Place the free space evenly between the children with some extra space at the beginning and end.

  6. Space Between: Evenly spaces children, but without extra space at the ends.

To change the Main Axis Alignment, move to the Properties Panel > Column Properties > Main Axis Alignment > select the preferred alignment option.

Adjust the Cross Axis Alignment

The Cross Axis for a Column Widget is the horizontal axis, so adjusting this will change how the child widgets are horizontally distributed in the column.

You can adjust the cross axis alignment using the following options:

  1. Start: Place child elements as close to the beginning as possible.

  2. Center: Place child elements as close to the middle as possible.

  3. End: Place child elements as close to the end as possible.

  4. Stretch: Expands each child to fill the column's width.

To change the Cross Axis Alignment, move to the Properties Panel > Column Properties > Cross Axis Alignment > select the preferred alignment option.

Sizing widgets inside the Column

See how to size widgets inside the Column.

Making column scrollable

When the total height of the children in a Column exceeds the available screen space, making the Column scrollable prevents content from being cut off or rendered inaccessible.

Showing empty list widget

See how to display an empty list widget when there is no data.

Add item spacing

See how to add space between items here.

Primary property

See how to use the primary property here.

Common widget properties

See how to work with Widget Styling, Visibility, Padding & Alignment, and Testing.


Video guide

If you prefer watching a video tutorial, here's the one for you:


Last Updated Date: January 22, 2024

Last updated