Is this is best, most optimized way to create this...
# compose
b
Is this is best, most optimized way to create this layered sheet?
Copy code
@OptIn(ExperimentalLayout::class)
@Composable
fun EditDialog(
    scaffoldState: ScaffoldState = remember { ScaffoldState() },
    bookmark: Bookmark? = null
) {

    Surface(
        modifier = Modifier.fillMaxSize(),
        color = MaterialTheme.colors.secondary
    ) {
        Box(shape = RoundedCornerShape(topLeft = 32.dp, topRight = 32.dp)) {
            Text(
                modifier = Modifier.padding(16.dp) + Modifier.padding(start = 8.dp),
                style = TextStyle(fontSize = 16.sp, fontFamily = FontFamily.Monospace),
                text = if (bookmark == null) "Create new bookmark" else "Edit"
            )
            Surface(
                modifier = Modifier.fillMaxSize(),
                color = MaterialTheme.colors.surface,
                shape = RoundedCornerShape(topLeft = 32.dp, topRight = 32.dp)
            ) {
                Box(
                    modifier = Modifier.padding(top = 48.dp, start = 4.dp, end = 4.dp),
                )
            }
        }
    }
}