remember Ambient Light State
inline fun rememberAmbientLightState(id: String = remember {
generateRandomLightId("ambient")
}, key: String? = null, crossinline init: AmbientLightState.() -> Unit = {}): AmbientLightState
Create and rememberSaveable a AmbientLightState using Saver. init will be called when the AmbientLightState is first created to configure its initial state.
This function does not automatically update the AmbientLightState if key is updated. To update state properties imperatively, use LaunchedEffect:
val light = rememberAmbientLightState()
LaunchedEffect(intensity) {
light.intensity = DoubleValue(intensity)
}Content copied to clipboard
Parameters
key
An optional key to be used as a key for the saved value. If not provided we use the automatically generated by the Compose runtime which is unique for the every exact code location in the composition tree.
init
A function initialise this AmbientLightState.