commonMain.com.paoapps.fifi.model.ModelEnvironment.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fifi-framework Show documentation
Show all versions of fifi-framework Show documentation
Kotlin Multiplatform Mobile framework for optimal code sharing between iOS and Android.
package com.paoapps.fifi.model
import com.russhwolf.settings.Settings
import com.russhwolf.settings.get
import com.russhwolf.settings.set
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
interface ModelEnvironment {
val name: String
val isOffline: Boolean
val isMock: Boolean
}
interface ModelEnvironmentFactory {
val defaultEnvironment: Environment
fun fromName(name: String): Environment
}
internal class EnvironmentSettings: KoinComponent {
val settings: Settings by inject()
val environmentName: String?
get() = settings["environment"]
fun setEnvironmentName(name: String) {
settings["environment"] = name
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy