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

commonMain.com.paoapps.fifi.model.ModelEnvironment.kt Maven / Gradle / Ivy

Go to download

Kotlin Multiplatform Mobile framework for optimal code sharing between iOS and Android.

There is a newer version: 0.0.31
Show newest version
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