It sounds like you want to make the Foo composable as tall as the Bar composable within a Row, while maintaining the original structure of your layout. One way to achieve this is by using a Box composable to wrap both Foo and Bar, and then applying a modifier to the Box to align both composables vertically and ensure that Foo takes up as much height as Bar.
Here's how you can modify your code:
Row {
Box(
modifier = Modifier
.fillMaxHeight()
.weight(1f) // This will make the Box (and Foo) take up equal space as Bar
) {
Foo()
}
Bar(cellSize = 80)
}
the Box will take up as much height as Bar due to the fillMaxHeight() modifier. The weight(1f) modifier ensures that the Box and Foo will take up equal space as Bar within the Row.
This approach maintains the structure of your layout while achieving the desired height alignment between Foo and Bar.