package io.element.android.features.${MODULE_NAME}.impl import android.os.Parcelable import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.bumble.appyx.core.composable.Children import com.bumble.appyx.core.modality.BuildContext import com.bumble.appyx.core.node.Node import com.bumble.appyx.core.plugin.Plugin import com.bumble.appyx.navmodel.backstack.BackStack import com.bumble.appyx.navmodel.backstack.operation.push import dagger.assisted.Assisted import dagger.assisted.AssistedInject import io.element.android.anvilannotations.ContributesNode import io.element.android.libraries.architecture.BackstackNode import io.element.android.libraries.architecture.animation.rememberDefaultTransitionHandler import io.element.android.libraries.architecture.createNode import io.element.android.libraries.di.AppScope import kotlinx.parcelize.Parcelize // CHANGE THE SCOPE @ContributesNode(AppScope::class) class ${FEATURE_NAME}FlowNode @AssistedInject constructor( @Assisted buildContext: BuildContext, @Assisted plugins: List, ) : BackstackNode<${FEATURE_NAME}FlowNode.NavTarget>( backstack = BackStack( initialElement = NavTarget.Root, savedStateMap = buildContext.savedStateMap, ), buildContext = buildContext, plugins = plugins, ) { sealed interface NavTarget : Parcelable { @Parcelize object Root : NavTarget } override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node { return when (navTarget) { NavTarget.Root -> { //Give your root node or completely delete this FlowNode if you have only one node. createNode<>(buildContext) } } } @Composable override fun View(modifier: Modifier) { Children( navModel = backstack, modifier = modifier, transitionHandler = rememberDefaultTransitionHandler(), ) } }