Lottie Animation

The Lottie widget plays vector animations from Lottie files. This is a powerful way to add complex, high-quality animations to your app with small file sizes.

Properties

Property
Description

sourceType

The source of the Lottie file. Can be network (from a URL) or asset (from local project files).

lottiePath

The URL or asset path for the Lottie JSON file.

width

The width of the animation widget.

height

The height of the animation widget.

fit

How the animation should be inscribed into the widget's bounds (e.g., contain, cover).

alignment

The alignment of the animation within its bounds.

animate

If true, the animation will play automatically.

animationType

The playback mode: loop (repeats indefinitely), once (plays one time), or boomerang (plays forward then backward).

frameRate

The frame rate at which to play the animation.


Default Properties

The Lottie widget supports the following sections of Default Properties:

Appearance

  • bgColor

  • borderRadius

  • border

    • borderWidth

    • borderColor

    • borderType (e.g., solid, dashed)

    • strokeAlign

Interactions

  • onClick — Used to add actions to the Lottie widget.

Last updated