lottie-flutter icon indicating copy to clipboard operation
lottie-flutter copied to clipboard

Random missing shapes

Open KubaStachecki opened this issue 6 years ago • 2 comments

I have a problem with disappearing elements - usually on the first loop on animation, and slower / older devices (but emulator also have this problem, and its just random - all devices, not just while on higher cpu use, not every time the same shape etc.) This is not dropped frames problem because some shapes stay and some disappear. Lottie files work on web, android and IOS preview seamlessly.

Example: https://lottiefiles.com/share/g7EvcC

Here is video presenting issue: https://drive.google.com/open?id=1pCLnmaAGezDF2F_NBoFZFQUBZGRWtL_A

Here is my flutter doctor:

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel beta, v1.2.1, on Microsoft Windows [Version 10.0.17134.590], locale pl-PL) [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [√] Android Studio (version 3.3) [√] Connected device (1 available)

• No issues found!

KubaStachecki avatar Mar 12 '19 14:03 KubaStachecki

My best guess is that parsing is just too slow. I'd like to experiment with another approach to Lottie before making any changes here, but I don't have a timeframe right now. I'd be happy to review PRs that address this though.

dnfield avatar Mar 12 '19 15:03 dnfield

Thanks for quick reply. I'm trying to figure it out (while shooting in the blind really since it's super random), but maybe, just maybe it got better after few tries. I have to test it longer to be sure. What I did (that may or may not have a connection to the case):

  • I made all animations 60fps in after effects (instead of previous 25fps)
  • I changed the duration of animations to a lower number (instead of the original amount of milliseconds- now they are slightly faster)
  • I changed the order of InitState so that controller and listener are set before asset loading. previously it was the other way around based on the example app:
@override
  void initState() {
    super.initState();

    _controller = new AnimationController(
      duration: Duration(milliseconds: duration),
      vsync: this,
    );
    _controller.addListener(() => setState(() {}));

    loadAsset(assetpath).then((LottieComposition composition) {
      setState(() {
        _composition = composition;
        _controller.repeat();
      });
    });
  }

KubaStachecki avatar Mar 12 '19 16:03 KubaStachecki