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

Can not render the Lottie animation

Open CalsRanna opened this issue 6 months ago • 1 comments

Here's the thing. I use code like below to render Lottie animations:

Lottie.network(
  entity.value,
  width: 60.r,
  height: 60.r,
  decoder: (bytes) => LottieComposition.decodeZip(
    bytes,
    filePicker: (files) {
      return files.firstWhereOrNull(
        (file) =>
            file.name.startsWith('animations/') &&
            file.name.endsWith('.json'),
      );
    },
  ),
),

But the problem is some Lottie will render correctly, but some will not render anything, and no errors in error builder. Such as 'https://aws-static.tmatch.com/de4/common/premiumWink/animations/balloon.lottie', it can not be rendered by the code up there, but in the lottiefiles.com/preview, in can be rendered. so the file has no issue.

It's strange, can someone tell me what happened plz. thx.

CalsRanna avatar Jun 18 '25 07:06 CalsRanna

You might be using a dotLottie 2.0 file, which has a slightly updated structure. Refer to https://github.com/xvrh/lottie-flutter/issues/405

kudanai avatar Jul 08 '25 16:07 kudanai