thenIfNotNull

inline fun <T> Modifier.thenIfNotNull(value: T?, onNotNull: Modifier.(T) -> Modifier): Modifier

Applies onNotNull when value is not null.

Inside onNotNull, value is known to be non-null.

Example:

Modifier.thenIfNotNull(backgroundColor) { color ->
background(color)
}