conditional

fun Modifier.conditional(condition: Boolean, modifierScope: Modifier.() -> Modifier): Modifier

An extension function that can be used to conditionally chain a modifier.

Parameters

condition

the condition based on which the modifier will be chained/not chained.

modifierScope

a lambda with an instance of Modifier as receiver.