Column

The Column widget is a layout widget that arranges its children in a vertical sequence. It is one of the most essential widgets for building layouts in a vertical orientation.

For a column widget, the main axis runs vertically and the cross axis runs horizontally.

Properties

Property
Description

mainAxisAlignment

How the children should be placed along the main (vertical) axis. Options include start, center, end, spaceBetween, spaceAround, and spaceEvenly.

crossAxisAlignment

How the children should be placed along the cross (horizontal) axis. Options include start, center, end, and stretch.

mainAxisSize

How much space the column should occupy on the main (vertical) axis. max tries to fill the available space, while min fits the size of its children.

isScrollable

If true, the column's content can be scrolled if it overflows the available space.

dataSource

A list of data that can be used to dynamically generate children widgets.

Child Properties

When you add a widget inside a Column, you can configure its expansion properties:

Property
Description

type

The type of expansion. Can be none (default), flex, or spacer.

flexValue

If the type is flex, this numeric value determines the proportion of space the child will occupy relative to its siblings.


Default Properties

The Column widget supports all three sections of default properties:

Layout

  • width

  • height

  • padding

  • margin

  • align

Appearance

  • bgColor

  • borderRadius

  • border

    • borderWidth

    • borderColor

    • borderType (e.g., solid, dashed)

    • strokeAlign

Interactions

  • onClick — Used to add actions to the Column widget.

Last updated