Package 

Class ViewModelInstanceKt

    • Method Detail

      • rememberViewModelInstance

        @Deprecated(message = Use rememberViewModelInstanceResult. This implementation will be removed in 12.0, when rememberViewModelInstanceResult will be renamed to rememberViewModelInstance and return a Result.)@Composable() final static ViewModelInstance rememberViewModelInstance(RiveFile file, ViewModelInstanceSource source)

        Creates a ViewModelInstance from the given file and source.

        The lifetime of the instance is managed by this composable. It will delete the instance when it falls out of scope.

        Parameters:
        file - The RiveFile to create the view model instance from.
        source - The source of the view model instance.
      • rememberViewModelInstanceResult

        @Composable() final static Result<ViewModelInstance> rememberViewModelInstanceResult(RiveFile file, ViewModelInstanceSource source)

        Creates a ViewModelInstance from file and exposes its creation state.

        The lifetime of a successfully created instance is managed by this composable. It will delete the instance when it falls out of scope.

        This is the replacement for rememberViewModelInstance; its temporary name will become rememberViewModelInstance in 12.0 when the unconfirmed API is removed.

        If source is null, the default artboard is created first and used to resolve its default view model and instance. If you already have an artboard, prefer ViewModelSource.DefaultForArtboard to avoid instantiating another artboard.

        Parameters:
        file - The RiveFile to create the view model instance from.
        source - The source of the view model instance, or null to use the default instance for the file's default artboard.