Hi. Can you please tell me why padding is not work...
# compose
b
Hi. Can you please tell me why padding is not working in this composable:
Copy code
Surface(
    modifier = Modifier.padding(10.dp)
    shape = AppTheme.shapes.medium,
    color = AppTheme.colors.surface
  ) {
  content()
}
It is only working when i add a box around the content(). is this the correct way to do it???
Copy code
Surface(
    shape = AppTheme.shapes.medium,
    color = AppTheme.colors.surface
  ) {
  Box(modifier = Modifier.padding(10.dp)) {
    content()
  }
}
d
Surface content lambda is passing PaddingValues:
content: @Composable (PaddingValues) → Unit