Box

data class Box(val width: Constraint, val height: Constraint, val margin: Margin, val horizontalAlignment: CrossAxisAlignment, val verticalAlignment: CrossAxisAlignment, val children: BoxScope.() -> Unit)

Lays out widgets along the z-axis in a column.

Minimum and maximum heights do not include margins.

Constructors

Link copied to clipboard
constructor(width: Constraint, height: Constraint, margin: Margin, horizontalAlignment: CrossAxisAlignment, verticalAlignment: CrossAxisAlignment, children: BoxScope.() -> Unit)

Properties

Link copied to clipboard

A slot to add widgets in.

Link copied to clipboard
val height: Constraint

Sets whether the box's height will match its tallest child (Constraint.Wrap) or match the height of its parent (Constraint.Fill).

Link copied to clipboard
val horizontalAlignment: CrossAxisAlignment

Sets the default horizontal alignment for widgets in this Box.

Link copied to clipboard
val margin: Margin

Applies margin (space) around the box.

Link copied to clipboard
val verticalAlignment: CrossAxisAlignment

Sets the default vertical alignment for widgets in this Box.

Link copied to clipboard
val width: Constraint

Sets whether the box's width will match its widest child (Constraint.Wrap) or match the width of its parent (Constraint.Fill).