DeferredAnimatedVisibility

@Composable
context(parentScope: ConstrainedScope)
fun <T> DeferredTransition<T>.DeferredAnimatedVisibility(visible: (T) -> Boolean, modifier: SwingModifier = SwingModifier, enter: EnterTransition = fadeIn() + expandIn(), exit: ExitTransition = shrinkOut() + fadeOut(), mutableTransform: MutableTransform? = null, content: @Composable AnimatedVisibilityScope.() -> Unit)

A container that animates content in and out as this deferred transition's state starts and stops satisfying visible. During a deferred phase, mutableTransform transforms the content.

A deferred phase, which a DeferredTransitionState begins with defer and ends with animateTo, does not advance the transition, so mutableTransform alone decides how the content looks. Drive it from the state a gesture writes:

val state = remember { DeferredTransitionState(false) }
val transform = remember { MutableTransform() }
transform.update { alpha = progress }
rememberTransition(state).DeferredAnimatedVisibility(
visible = { it },
mutableTransform = transform,
) { Details() }

When the phase ends in a transition, enter and exit continue each value from where the transform left it; see MutableTransform.

Otherwise behaves as the Transition overload. Requires a ConstrainedScope.

Parameters

visible

whether the content is shown for a given state of this transition.

modifier

the SwingModifier applied to the container.

enter

how the content appears; a fade in together with an expansion from nothing by default.

exit

how the content disappears; a shrink to nothing together with a fade out by default.

mutableTransform

how the content is transformed during a deferred phase; null by default, which transforms nothing.

content

the composable content of the container; see AnimatedVisibilityScope.