Is there an efficient way to make adaptive grid's item height equal to the width determined in runtime? Basically I want square items.
So far I've tried this:
var size by remember { mutableStateOf(IntSize.Zero) }
Column( // item
...
.onSizeChanged {
size = it
}
.size(with(LocalDensity.current) {
size.width.toDp()
})
)
but I'm new to compose and think it might be an expensive operation. Any alternatives?