Function

getOrElse

Returns the resolved value of property if set, or the result of defaultValue.

getOrElse

Source set: Common
public inline fun <T> StylePropertyAccessorScope.getOrElse(
    property: StyleProperty<T>,
    crossinline defaultValue: () -> T,
): T

Returns the resolved value of property if set, or the result of defaultValue.

Parameters

property property to retrieve
defaultValue fallback calculation when property is not set
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: