I have a screen with a 2 by 2 grid of rectangles. I want the rectangles to fill all available width only if the width of the square is 120dp. The width would not exceed 120dp even if there is possibly 200dp more to fill.
The below code does not work and it still occupies the available width even though it exceeds 150.dp.
Row(Modifier.fillMaxWidth()) {
Text(
Modifier
.widthIn(150.dp)
.height(100.dp)
.weight(0.5f)
)
Text(
Modifier
.widthIn(150.dp)
.height(100.dp)
.weight(0.5f)
)
}