All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.softartdev.theme.pref.PreferenceHelper.kt Maven / Gradle / Ivy

Go to download

Kotlin Multiplatform library for easy switching Dark/Light Material themes on Compose.

The newest version!
package com.softartdev.theme.pref

import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember

interface PreferenceHelper {

    var themeEnum: ThemeEnum

    fun clear()
}

const val THEME_KEY: String = "theme_key"

@Composable
expect fun obtainPreferenceHelper(): PreferenceHelper

@Composable
fun rememberPreferenceHelper(): PreferenceHelper {
    val preferenceHelper = obtainPreferenceHelper()
    return remember { preferenceHelper }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy