Flutter performance issue with Lottie animation
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
Ravi Parmar
Updated on December 06, 2022Comments
-
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
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.
Lottie animation without dialog