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

iosMain.kottieComposition.rememberkottieComposition.ios.kt Maven / Gradle / Ivy

There is a newer version: 1.9.6
Show newest version
package kottieComposition

import androidx.compose.runtime.Composable
import kotlinx.cinterop.ExperimentalForeignApi
import lottie.lottieComposition.LottieCompositionSpec
import lottie.lottieComposition.rememberLottieComposition


@OptIn(ExperimentalForeignApi::class)
@Composable
actual fun rememberKottieComposition(
    spec: KottieCompositionSpec
): Any? {
    return when(spec){
        is KottieCompositionSpec.File -> {
            (kottieComposition(spec = spec) as? LottieCompositionSpec)?.let {
                rememberLottieComposition(it)
            }
        }
        is KottieCompositionSpec.Url -> {
            (kottieComposition(spec = spec) as? LottieCompositionSpec)?.let {
                rememberLottieComposition(it)
            }
        }
        is KottieCompositionSpec.JsonString -> {
            (kottieComposition(spec = spec) as? LottieCompositionSpec)?.let {
                rememberLottieComposition(it)
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy