thenIf

fun Modifier.thenIf(condition: Boolean, ifFalse: @Composable Modifier.() -> Modifier? = null, ifTrue: @Composable Modifier.() -> Modifier): Modifier

Conditionally applies one of two @Composable modifier steps — the branch-and-chain idiom behind Modifier.styledWith's combinedClickable step, applied only when onClick/onLongClick is non-null.

Return

the receiver with the chosen step appended.

Parameters

condition

which branch to take.

ifFalse

builds the step to apply when condition is false. Leaves the chain untouched (returns the receiver as-is) when null, the default.

ifTrue

builds the step to apply when condition is true.