lottie-flutter
lottie-flutter copied to clipboard
Can not render the Lottie animation
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.
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