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

commonMain.ru.alexgladkov.odyssey.compose.helpers.FlowBuilderModel.kt Maven / Gradle / Ivy

There is a newer version: 1.4.0-alpha05
Show newest version
package ru.alexgladkov.odyssey.compose.helpers

import ru.alexgladkov.odyssey.compose.AllowedDestination
import ru.alexgladkov.odyssey.compose.RenderWithParams
import ru.alexgladkov.odyssey.compose.ScreenType

data class FlowBuilderModel(
    val key: String,
    val allowedDestination: List,
    val screenMap: HashMap>
)

class FlowBuilder(val name: String) {
    private val _screenMap: HashMap> = hashMapOf()
    private val _allowedDestinations: MutableList = mutableListOf()

    fun addScreen(name: String, content: RenderWithParams) {
        _allowedDestinations.add(AllowedDestination(key = name, screenType = ScreenType.Simple))
        _screenMap[name] = content
    }

    fun build(): FlowBuilderModel {
        return FlowBuilderModel(
            key = name,
            screenMap = _screenMap,
            allowedDestination = _allowedDestinations
        )
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy