Hi , How can I put dynamic composables inside a co...
# compose
w
Hi , How can I put dynamic composables inside a constraint layout? (Attached sample code as first comment)
Copy code
@Composable
fun SnackBarContent(
  test1 : (@Composable () -> Unit),
  test2 : (@Composable () -> Unit)
){
  ConstraintLayout() {
    
  }
}
c
Does putting
test()
or
test2()
in the CL block not work?
w
In constraint layout I have to define the constraints. Which is not accessible if I just pass test() , and test()
f
You could wrap test1 and test2 in a
Box
with
propagateMinConstraints
c
You can also add more parameters to your Composable content parameters, e.g. test1: @Composable (refs) -> Unit
You could wrap test1 and test2 in a
Box
FWIW if you’re already starting to use things like Box, it begs the question do you really need ConstraintLayout