Flutter performance issue with Lottie animation

402

You must use TickerProvider to tell flutter engine to avoid useless rendering animation

in fact with TickerProvider you can stop, pause animation when it dnt show

check this for more detailed info

Share:
402
Ravi Parmar
Author by

Ravi Parmar

Updated on December 06, 2022

Comments

  • Ravi Parmar
    Ravi Parmar over 1 year

    I have noticed a couple of things when integrating Lottie animations in a flutter. And I want to know how can we improve the performance with Lottie in a flutter

    The Test is done on One Plus 7T mobile.

    1.) Lottie animated file renders the view frequently and the frame rate is 30

    Can this be improved? I have already taken out Lottie in a separate stateless widget to avoid rendering the entire widget every time

    enter image description here

    2.) There is a second scenario where the performance is heavily impacted and I think flutter core has to do something in this.

    Suppose you have a screen with flutter animation or some gif going on and you open a dialog with another flutter file running,the screen will render a lot in this case as two animations are running.

    The flutter core should be clever enough to prevent any such render on the screen with the focus move to the dialog instead of running both animation.

    With Two lottie animations one on dialog and one below the screen.

    enter image description here

    Lottie animation without dialog

    enter image description here