@Composable
fun ColumnScope.FillSpacer(): Unit = Spacer(Modifier.weight(1.0f))
Now I try to figure out how I can define my
val
for that.
I find it a bit tricky because of the ColumnScope.
a
Adam Powell
07/01/2022, 12:59 PM
Technically a future version of the compose libraries could implement weight in such a way that the underlying modifier returned can't be reused and is bound to the parent column instance, so you can't really accomplish what you're trying to do robustly and safely. Honestly though, it's probably not worth trying. What you've already written here is skippable in recomposition and it's going to allocate more objects than the modifier in initial composition anyway