supportingContent should be null if there is nothing to display.

This commit is contained in:
Benoit Marty
2024-05-27 18:02:14 +02:00
committed by Benoit Marty
parent ae9d19bc80
commit b32cebf2c0

View File

@@ -61,14 +61,16 @@ fun PreferenceCheckbox(
color = enabled.toEnabledColor(),
)
},
supportingContent = {
if (supportingText != null) {
supportingContent = if (supportingText != null) {
{
Text(
style = ElementTheme.typography.fontBodyMdRegular,
text = supportingText,
color = enabled.toSecondaryEnabledColor(),
)
}
} else {
null
},
trailingContent = ListItemContent.Checkbox(
checked = isChecked,