rememberVisibilityState

Provides a MutableState of VisibilityState that is remembered across recompositions.

This function creates and remembers a VisibilityStateImpl instance, which manages the visibility state with the specified initial state.

Return

A MutableState containing the remembered VisibilityStateImpl instance.

Parameters

initialState

The initial visibility state. Defaults to false.


Provides a MutableState of VisibilityState using the provided factory to create it.

This function is used to retain a mutable state of a VisibilityState within a Composable function. The factory is responsible for creating instances of VisibilityState, allowing flexibility in how different types of visibility states are instantiated and managed.

Return

A mutable state holding the instance of VisibilityState.

Parameters

initialState

The initial visibility state for the state.

factory

A factory interface that creates instances of VisibilityState.


inline fun <T : VisibilityState> rememberVisibilityState(initialState: Boolean = false, crossinline factoryProvider: VisibilityStateFactoryProvider<T>): MutableState<T>

Provides a MutableState of VisibilityState using a factory provider function to create it.

This function retains a mutable state of a VisibilityState within a Composable function. The factoryProvider function is used to create instances of VisibilityState.Factory, allowing for flexible instantiation.

Return

A mutable state holding the instance of VisibilityState.

Parameters

initialState

The initial visibility state for the state.

factoryProvider

A function to provide the VisibilityState.Factory for creating instances of VisibilityState.