I'm working with LazyVerticalGrid in Jetpack Compose where I have items with varying spans (e.g., some items take up 1 span, others take up 4 spans). I need to compute the verticalScrollRange() of the grid, but I'm unsure how to correctly account for the varying span sizes.
I understand that the scroll range should be calculated by considering the height of each item, but since the items have different span counts, I need a way to incorporate this into the scroll range calculation.
How can I compute the verticalScrollRange() correctly when the grid items have different span sizes? Is there a way to factor in the span count of each item in the grid to get an accurate scroll range?