I'm coming up with minimal reproducible code to fr...
# compose
k
I'm coming up with minimal reproducible code to frame this design problem. I want to arrange column of custom layouts at the top.
Copy code
Column(
    Modifier.fillMaxHeight().preferredWidth(72.dp),
) {
    MockItem(Icons.Filled.Home)
    MockItem(Icons.Filled.Search)
    MockItem(Icons.Filled.Settings)
    MockItem(Icons.Filled.Email)
}
The MockItem is my custom layout which is currently just placing items at (0,0) but is much convoluted than this
Copy code
@Composable
fun ColumnScope.MockItem(icon: VectorAsset) {
    Box(Modifier.weight(1f)) {
        Layout(children = {
            Icon(icon)
        }) { measurables, constraints ->
            val placeable = measurables.first().measure(constraints)
            layout(constraints.maxWidth,constraints.maxHeight) {
                placeable.placeRelative(0,0)
            }
        }
    }
}
When I put
Modifier.weight(1f)
, the layouts get equal amount of space in the column whereas, removing the same allocates the entire column height to first item. My goal is to gain the ability arrange items vertically (Top,Center,Bottom). Am I supposed to drop
Column
altogether and build my own "Column" here?