b

    bodo

    11 months ago
    Hi. Can you please tell me why padding is not working in this composable:
    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???
    Surface(
        shape = AppTheme.shapes.medium,
        color = AppTheme.colors.surface
      ) {
      Box(modifier = Modifier.padding(10.dp)) {
        content()
      }
    }
    divid3d

    divid3d

    11 months ago
    Surface content lambda is passing PaddingValues:
    content: @Composable (PaddingValues) → Unit