Interface

HostDefaultProvider

An interface that allows the hosting environment (e.g., Android, Desktop, or iOS) to provide default values for CompositionLocal using compositionLocalWithHostDefaultOf.

Source set: Common
public interface HostDefaultProvider

An interface that allows the hosting environment (e.g., Android, Desktop, or iOS) to provide default values for CompositionLocal using compositionLocalWithHostDefaultOf.

This acts as a decoupling layer, allowing platform-agnostic libraries to request platform-specific components ((like LifecycleOwner or ViewModelStoreOwner) without depending on platform-specific APIs or artifacts.

Functions

getHostDefault

Source set: Common
public fun <T> getHostDefault(key: HostDefaultKey<T>): T

Retrieves a value associated with key from the host environment.

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: