I want to achieve this using jetpack compose.
A is scrollable list of row items. When A is smaller than screen(or parent) size, B(footer) should be placed bellow the last row. When A + B are bigger than screen size, then B becomes fixed at the bottom and A content is scrollable. I'm wondering if there is easy way to achieve this, using compose ConstraintLayout.
The solution is to use
Modifier.weight(1f, false)
in A. This is because the parent element's size will first be used by unweighted elements and then the remaining space will be distributed to weighted elements according to their weights. See this answer for more details.