LottieFilePainter

A Lottie animation icon that animates based on the current theme state.

This implementation displays a Lottie animation with its progress animated between startProgress and endProgress based on the theme state. The animation smoothly transitions when the theme changes using the specified animationSpec.

The Lottie composition is loaded asynchronously using onReadContent, which returns a LottieCompositionSpec that defines the animation source (Lottie JSON, DotLottie file, etc.).

Parameters

animationSpec

The animation specification controlling the interpolation between progress values during theme transitions.

startProgress

The Lottie animation progress value (0.0f to 1.0f) to display when in dark theme.

endProgress

The Lottie animation progress value (0.0f to 1.0f) to display when in light theme.

onReadContent

A suspend function that provides the Lottie composition specification. This is called when the icon is first composed and may perform I/O operations to load the animation source.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val onReadContent: suspend () -> LottieCompositionSpec
Link copied to clipboard

Functions

Link copied to clipboard
open override fun Icon(state: ThemeAnimationState, tint: Color, modifier: Modifier, contentDescription: String?)

Renders the icon based on the current theme state.