This good practice in compose?
# compose
j
This good practice in compose?
message has been deleted
Copy code
@Composable
fun FlightComponent(){
    Box(modifier = Modifier
        .fillMaxWidth(0.9f)
        .height(191.dp)
    ){
        Row {
            Column {
                Column {
                    Text("DEPART")
                    Text("CODE")
                    Text("NAME")
                }
                Column {
                    Text("ARRIVE")
                    Text("CODE")
                    Text("NAME")
                }
            }
            Icon(
                imageVector = Icons.Default.Favorite,
                contentDescription = null
            )
        }
    }
}
Put column inside column?
c
You will have the same effect with just leaving the inner columns out. What’s your intention for doing this?
j
Widget alignment
@Chrimaeon
c
Yeah, you don’t need the inner columns. Just put a spacer after the third text composable.
j
But is the spacer considered good practice?
c
Also no need to tag someone that already replied. I get the notification ;-)
Sure, why not?
j
I don't know, I'm still starting out so I don't know what is good practice and what isn't
I was from flutter
c
In flutter you would do the same without the inner columns I hope and use a SizedBox to get the margins between the elements.
j
Yes, that's right, to get better at compose, what do you advise me to do? There isn't much content on the internet
c
Spacer is the same as SizedBox. Use a modifier to give it a height .
Look at Open Source project and see what others do. If you like it , do the same. 😅
j
I understand!! Thanks!!
❤️
c
✌️