Lottie Splash Screen on Flutter
Asked Answered
U

2

7

I want to add a Lottie animation for a splash screen before any content launches in my Flutter app. The plugins I've checked out don't completely support all features of the animations yet or don't work as desired.

Is there some way I can add it before the actual flutter activity launches. I want the animation to completely finish, and only then go forward to the main content.

Any help appreciated, thanks!

Utrecht answered 26/3, 2019 at 1:23 Comment(2)
which plugin have you checked out?Ipoh
Does this thread answer your question? #44380349Souse
M
4

Currently the Lottie plugins for Flutter do not work that well (hopefully they are improved soon) but what I did for my app is save the animation as a .gif (set repeat to once) which can then natively be displayed in an ImageView, then use a timer to move to the next screen one the animation has finished.

Not the ideal solution but a work around until the plugins have been improved.

Masry answered 26/3, 2019 at 19:40 Comment(1)
yup that's what I'm going ahead with for now. Will mark your answer correct if there are no better ones. Thanks :DUtrecht
P
0

You can use lottie plugin. lottie: ^0.7.0+1 And then use status listener provided by AnimationController. Code below:

  _controller = AnimationController(vsync: this)
        ..addStatusListener((status) {
    if(status == AnimationStatus.completed){
//Move to next page
        
}
Pacifier answered 14/12, 2020 at 9:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.