LayoutScope

Direct-child placement scope for one parent layout pass.

The scope is owned by the LayoutNode.layout callback and is valid only until that callback returns. Every access must use the tree's owner thread. Access after the callback or from another thread fails. Only children measured in the current pass may be placed, and each such child may be placed once. An invalid index, an unmeasured child, or a second placement throws. The tree is poisoned once pipeline work has started only when that exception escapes the owning layout callback.

Properties

Link copied to clipboard
abstract val childCount: Int

The number of direct retained children.

Link copied to clipboard
abstract val size: IntSize

The size assigned to this node.

Functions

Link copied to clipboard
abstract fun <D : Any> childParentData(index: Int, key: ParentDataKey<D>): D?

Returns the current parent-data value supplied by one direct child's modifier chain.

Link copied to clipboard
abstract fun measuredChildSize(index: Int): IntSize

Returns the size measured for a direct child.

Link copied to clipboard
abstract fun placeChild(index: Int, offset: IntOffset)

Places one measured direct child at an offset in this node's local coordinates.