ColumnComponent¶
class ColumnComponent
extends LinearLayoutComponent
Warning: Experimental. API and behavior may change.
ColumnComponent is a layout component that arranges its children in a vertical column.
The children
are laid out along the vertical axis, with spacing between
them defined by the gap
parameter.
The alignment of the children along the vertical axis is controlled by
mainAxisAlignment
, while their alignment along the horizontal axis is
controlled by crossAxisAlignment
.
If size
is non-null, behaves as normal explicit sizing.
If size
is null, sets the size to the minimum size that containing all
the children. This is similar to setting the size
to intrinsicSize
, but
distinct in that sizing will respond to changes in children, other
properties, etc…
Example usage:
ColumnComponent(
gap: 10.0,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextComponent('Child 1'),
TextComponent('Child 2'),
TextComponent('Child 3'),
],
);
Constructors¶
ColumnComponent({super.key, super.mainAxisAlignment = MainAxisAlignment.start, super.crossAxisAlignment = CrossAxisAlignment.start, super.gap = 0.0, super.size, super.position, super.anchor, super.priority, super.children})
The content on this page is licensed under the CC BY 4.0 License,
and code samples under the MIT License.