Skip to content

BoxMeasurePolicy

Constructors

BoxMeasurePolicy

constructor(alignment: Alignment)

Properties

arrangementSpacing

Parameters

  • arrangementSpacing: Additional pixels added between siblings by the arrangement.

sumHeight

Parameters

  • sumHeight: When true, each child's height is subtracted from the remaining max-height before the next child is measured (Column behaviour).

sumWidth

Parameters

  • sumWidth: When true, each child's width is subtracted from the remaining max-width before the next child is measured (Row behaviour).

Functions

measure

open override fun measure(
    scope: MeasureScope, 
    measurables: List<Measurable>, 
    constraints: Constraints
): MeasureResult

Measures measurables within constraints and returns a MeasureResult.

Parameters

  • scope: The LayoutNode currently being measured (implements MeasureScope).

  • measurables: The child nodes to measure.

  • constraints: The size constraints imposed by the parent.

placeChildren

open override fun placeChildren(
    scope: MeasureScope, 
    measurables: List<Measurable>, 
    placeables: List<Placeable>, 
    width: Int, 
    height: Int
): MeasureResult

Positions all measured placeables within width × height and returns the MeasureResult.

Parameters

  • scope: The measuring LayoutNode.

  • measurables: The original measurables (for modifier access).

  • placeables: The measured placeables to position.

  • width: The resolved container width.

  • height: The resolved container height.