2d-inc / Flare-Flutter

Load and get full control of your Rive files in a Flutter project using this library.
https://rive.app/
MIT License
2.55k stars 469 forks source link

Lottie To Flare conversion - NoSuchMethodError: The getter 'iterator' was called on null. #178

Open kenwen opened 4 years ago

kenwen commented 4 years ago

Hi,

I'm able to use the FlareActor widget with Flare assets but I've just tried to convert a Lottie file to Flare which does not appear to work. Getting the above error.

Using the latest version of flare flutter

Here's the animation file

https://www.2dimensions.com/a/kenwen/files/flare/loading-spinner

Thanks :)

umberto-sonnino commented 4 years ago

I see that your file has an empty Artboard as it's first one, but if you want to use your lottie animation you need to specify the correct Artboard (i.e. loading-animation) with a widget parameter, like this:

FlareActor(
  "assets/loading-spinner.flr",
  artboard: "loading-animation",
  alignment: Alignment.center,
  fit: BoxFit.contain,
  animation: "animate",
)

We're going to issue a fix for the iterator crash you encountered, thanks for your report!

luigi-rosso commented 4 years ago

Could you try this again with the latest flare_flutter: ^1.7.0 and let us know if the issue is fixed? Thanks!