xvrh / lottie-flutter

Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
https://pub.dev/packages/lottie
MIT License
1.15k stars 197 forks source link

Animation is pausing when I am issuing a "sleep" call #269

Open kbessemer opened 1 year ago

kbessemer commented 1 year ago

The animation is pausing everytime I call sleep, which is necessary for my app at times. Is there a way to have the animation play anyways? It seems to pause when sleep starts, and resume when it stops.

Lottie.asset('assets/loading.json');

sleep(Duration(milliseconds: sleepAmount));

xvrh commented 1 year ago

I don't think it is an issue with this library. I guess all animation are paused when you use the sleep function. I recommend re-working your code and using something like await Future.delayed(Duration(milliseconds: sleepAmount)).