ifNull

inline fun <T : Any> ERROR CLASS: Symbol not found for Modifier.ifNull(value: T?, chain: ERROR CLASS: Symbol not found for Modifier.() -> ERROR CLASS: Symbol not found for Modifier): ERROR CLASS: Symbol not found for Modifier

Modifier to make it easy to conditionally add a modifier based on value nullability

Box(
modifier = Modifier.fillMaxWidth()
.ifNull(errorMetadata) { errorData -> background(errorData.valid) }
.padding(16.dp)
) {...}

Parameters

value

decide if the chain is added or not to the modifier chain

chain

the modifier(s) to apply when value is null