hello everyone, I have a small question. A lot of ...
# compose
h
hello everyone, I have a small question. A lot of time I to write my code like this:
Copy code
AssistChip(
                onClick = {},
                label = {
                    Text(text = label)
                },
                enabled = enabled,
                leadingIcon = optionalLeadingIcon?.let {
                    {
                        Icon(
                            it,
                            contentDescription = "Localized description",
                            Modifier.size(AssistChipDefaults.IconSize)
                        )
                    }
                },
                trailingIcon = optionalTrailingIcon?.let {
                    {
                        Icon(
                            it,
                            contentDescription = "Localized description",
                            Modifier.size(AssistChipDefaults.IconSize)
                        )
                    }
                },
            )
Is there a better way to improve the check if not null return a composable function? I'm thinking of create a new scope function named
letCompose
so that I don't have to use double
{ {
and
} }
r
Double
{ {
&
} }
are fine and simple, we use them in our codebase