LayoutFunction1
A layout function for a container with exactly one child, which it receives by name.
Layout(icon) { child, c ->
val placeable = child.measure(c)
layout(c.maxWidth, placeable.height) {
placeable.place(x = (c.maxWidth - placeable.width) / 2, y = 0)
}
}Content copied to clipboard
Naming the children beats indexing a list for them: measurables[0] is a lookup that can be wrong, child cannot be.
Functions
Link copied to clipboard
The tallest this container would like to be at width, ignoring any upper bound.
Link copied to clipboard
The widest this container would like to be at height, ignoring any upper bound.
Link copied to clipboard
Measure the children, then say how big this container is and where each child goes.
Link copied to clipboard
The shortest this container can be at width. The other axis of minIntrinsicWidth.
Link copied to clipboard
The narrowest this container can be at height without its content breaking out of it.