Can parameter modifier is used inner composable

HI
I am trying to understand why can’t ‘modifier’ parameter in Fun ‘Card’ be used in TEXT composable in the Column composable. The ‘modifier’ parameter can be used in Column composable. Why it is accepting ‘Modifier’ not ‘modifier parameter’ in TEXT composable. Thank you.

fun Card(onef: String, ones: String, twof: String, twos: String, modifier: Modifier) {
Column(verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, modifier = modifier) {
    Row{
        Column(verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, modifier = *modifier*.padding(16.dp)) {
            Text(text = onef, fontWeight = FontWeight.Bold, modifier=**Modifier**.padding(bottom = 16.dp))
            Text(text = ones,modifier=**Modifier**.padding(8.dp))
        }


modifier param must be used only on the top container of your Composable, because it cares external limits to your composable, all child composables must use unbounded Modifier with effects you need for layout/pointerinput/interactions/rendering

2 Likes

what if the modifier from outside has multiple parts, some for external limits etc. and some for other things, e.g. clickable.

Is there a possibility to split it into those parts (filter?), to use some in outer Column and others inside?
I guess, I could use more than one modifier parameter to make this more clear.

Sometimes it could also be helpful to filter modifiers for other reasons, e.g. to suppress something dependent on an inner state. This may especially be useful for more complex composables.