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 6339bb6235
commit 79057678d7
@@ -61,14 +61,16 @@ fun PreferenceCheckbox(
color = enabled.toEnabledColor(), color = enabled.toEnabledColor(),
) )
}, },
supportingContent = { supportingContent = if (supportingText != null) {
if (supportingText != null) { {
Text( Text(
style = ElementTheme.typography.fontBodyMdRegular, style = ElementTheme.typography.fontBodyMdRegular,
text = supportingText, text = supportingText,
color = enabled.toSecondaryEnabledColor(), color = enabled.toSecondaryEnabledColor(),
) )
} }
} else {
null
}, },
trailingContent = ListItemContent.Checkbox( trailingContent = ListItemContent.Checkbox(
checked = isChecked, checked = isChecked,