thenUnless

Like thenIf but with an inverted condition.


inline fun Modifier.thenUnless(condition: Boolean, lazyProduce: () -> Modifier): Modifier(source)

Like the version of thenUnless which takes in a modifier directly, but it produces that modifier lazily.

This is occasionally useful if you have a Modifier that is expensive to create, e.g. it takes some complicated parameters you need to allocate which is a waste if the condition is true.