Android Compose: Modifier vs other arguments - What's the meaning of the Modifier-object?

72 views Asked by At

A code snippet from a Compose-course, which I'm currently doing:

Card(
            modifier = Modifier
                .width(200.dp)
                .height(390.dp)
                .padding(12.dp),
            shape = RoundedCornerShape(corner = CornerSize(15.dp)),
            backgroundColor = Color.White,
            elevation = 4.dp
        ) {
            ...

Why isn't everything attached to the Modifier or everything passed as key-value pairs? What's the special role and meaning of the modifier-object? Why is there this differentiation?

0

There are 0 answers