commonMain.com.arkivanov.decompose.extensions.compose.stack.animation.EmptyStackAnimation.kt Maven / Gradle / Ivy
package com.arkivanov.decompose.extensions.compose.stack.animation
import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.Composable
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.ui.Modifier
import com.arkivanov.decompose.Child
import com.arkivanov.decompose.router.stack.ChildStack
internal fun emptyStackAnimation(): StackAnimation =
EmptyStackAnimation()
/*
* Can't be anonymous. See:
* https://github.com/JetBrains/compose-jb/issues/2688
* https://github.com/JetBrains/compose-jb/issues/2612
*/
private class EmptyStackAnimation : StackAnimation {
@Composable
override fun invoke(
stack: ChildStack,
modifier: Modifier,
content: @Composable (child: Child.Created) -> Unit,
) {
Box(modifier = modifier) {
content(stack.active)
}
}
}